Tag Info

Hot answers tagged

35

zcat /path/to/file.sql.gz | mysql -u 'root' -p 'password' your_database > will write the output of the mysql command on stdout into the file myfile.sql.gz which is most probably not what you want.


15

Yeah, this was a nuisance I had to deal with a while ago. Here's a snippet from a script that dealt with converting a bunch of CSV files into mysql tables: COLLIST=`head -1 $table.csv` mysql --execute="LOAD DATA INFILE '$WORKDIR/$table.csv' INTO TABLE $table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' IGNORE 1 LINES ($COLLIST); SHOW WARNINGS" > ...


12

The simplest way is to unzip the database file before importing. Also as mentioned by @Prof. Moriarty you shouldn't be specifying the password in the command (you'll be asked for the password). This command taken from webcheatsheet will unzip and import the database in one go: gunzip < myfile.sql.gz | mysql -u root -p mydb


10

To display a progress bar while importing a sql.gz file, download pv and use the following: pv mydump.sql.gz | gunzip | mysql -u root -p In CentOS/RHEL, you can install pv with yum install pv.


8

You want to run the dump through the mysql client. Example: mysql -uroot -p testimport < database.dump


7

For this reason I always use mysqldump --hex-blob. Re-dump the database encoding the blobs using this switch and it will work. You can try to import it using a windows mysql client IDE like sqlyog or mysql administrator. It worked for me once.


7

It seems to me that your .sql file actually contains the text <br /> <b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b, which is obviously not valid sql. You have possibly exported your database with some tool like phpMyAdmin, which took longer than 300s to create the export which was cut short at that point in ...


6

Try reversing the redirection: mysql -u root -p databasename < D:/database.sql '>' means to redirect the stdout; '<' redirects stdin If you are indeed using phpMyAdmin, as you say you are, you can log in to it with your same credentials and go to the "Import" tab (one before the last one) and upload the file.


6

Alternatively there's this: http://www.ioncannon.net/system-administration/1246/converting-from-virtualbox-or-vmware-to-ec2-now-easier-than-ever/ which sounds like if you just have an EC2 compatible kernel...


4

If the records are already in a file, your best bet may be to edit the existing zone file directly (usually in the %SystemDir%\System32\dns folder). Open the file for the zone in question and paste the records in at the bottom of the file. Ensure the record format is the same as existing records (for example, it's simply CNAME rather than Alias(CNAME) and ...


4

If it's not all one table you might want to split into multiple files and load each one in a seperate client (it'll go faster as well as make isolating the error easier).


3

If this is not a version mismatch, then the backup file could be actually corrupted. If this is the case, you're not going to be able to (at least easily) recover anything from it.


3

log in to another mysql window and type, you'll see where it "stuck"... SHOW PROCESSLIST; using that information you'll be able to adjust your my.cnf and make that import go a lot quicker. also take a look at your mysqld.log make sure everything is clean there whenever you start mysqld, this will also gives you an indication if something is wrong ...


3

Copy /var/spool/mqueue directory: old# tar -zpcvf mqueue.tar.gz /var/spool/mqueue old# scp mqueue.tar.gz newserver: new# tar -zpxvf mqueue.tar.gz -C /


3

What you want to do should work using the vboxmanage import command. Use vboxmanage --dry-run to get a list of the parameters that will be used to import the appliance, these can be over ridden by following the instructions in the output of the dry run. Import copies the appliance files to the default hard disk storage location. You may want to change ...


3

You didn't say what version. Since we're talking SQL Server, there are several ways to approach this. If you're on SQL Server 2005/2008, the easiest way is to probably use the Import Data function within SQL Server Management Studio. Actually, what this does is creates an SSIS package that allows you to bring data in to the combined database. This is a ...


3

I can't answer your question directly, but perhaps help a bit anyways. First of all, I was going to do some exporting and importing when rebuilding out two Hyper-V servers as a cluster when R2 came around with Live Migration support. I tried exporting and importing, but could not get it right. I found no simple answers to why either, so I simply ended up ...


3

You may want to look at FmPro Migrator. It will convert FileMaker Pro (2,3,4,5,6,7,8,9,10) to a SQL Database (MySQL, Oracle, Access, Microsoft SQL Server, Sybase, DB2, OpenBase, PostgreSQL, FrontBase, SQLite and Valentina). You could also FileMaker Instant Web Publishing. It's part of FileMaker Server Advanced and is also part of the client FileMaker. It's ...


3

Like the others said the real problem is that for SHOW WARNINGS to work you have to be in the same connected session. mysqlimport disconnects from the session as soon as it's finished importing, making the capture of it's warnings impossible in it's current version. Sounds like an opportunity to donate a patch. :)


3

The first container names lack the container type from your third statement on down to the bottom, and you don't have the first one quoted (for consistency). For example, it should be "ou=Chicago Admins,ou=Chicago,ou=IL,dc=sawahcompany,dc=com".


2

You already have a job in the target database that is numbered 99. You'll need to drop that job. Edit: The ISUBMIT procedure of dbms_job is a bit hard to find docs on. Here is where I found some. That procedure submits a job with a specified job number, whereas the SUBMIT procedure assigns a job number for you, avoiding this very problem. To remove the ...


2

Also check if there is any USE-statement in the SQL file. Specifying the database at the command line doesn't guarantee that the data ends up there if a different destination is specified within the SQL file.


2

It turns out I needed to have both Outlook 64bit, 32bit will not work. I also needed to assign a role to my user: New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “USER” I found the solution here.


2

Found the answer. There were some --- missing at the beginng.


2

Try the full path to the file: mysqlimport -u wendel2go -p --fields-terminated-by='\t' b2g /home/username/Desktop/gene2accession Replace "username" with your user name.


2

There is the standalone vmware converter that will convert between different virtual machine formats. You may also want to read this which gives information on how to convert from vmware images to ec2 AMIs Or do it directly with this


2

LDAP users will not be present in /etc/passwd. In a Unix system, /etc/passwd is only one of a number of places it can look for directory information, including users and groups. Where it looks is controlled by /etc/nsswitch.conf. To see if you actually have successfully imported your users in a way Ubuntu understands, use the getent command to retrieve ...


2

You need to locate the various database files on your old hard disc. There will be a minimum of one data file (*.mdf) and one log file (*.ldf). Then copy them over and attach them using SSMS (Right click the "Databases" node in object explorer and choose the "Attach" option in the context menu).


2

You can set the environment variable NLS_LANG before executing imp or sqlplus. On windows system, if this environment variable is not set, Oracle will look into the windows registry. C:\>set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15 C:\>sqlplus vnz/[...] [...] SQL> select to_char(sysdate, 'month') from dual; TO_CHAR(S --------- october SQL> ...


2

Are you sure that the backup consisted of one file? If you have the free space on the source server that the backup came from (assuming it is still operational) you could try restoring the backup to a new database to confirm that the backup is good



Only top voted, non community-wiki answers of a minimum length are eligible