I have ubuntu 14 (nginx) and I’m ran that command to duplicate/export my database:
mysqldump -u[user] -h[localhost] -p[pwd] database1 > /home/database1.sql
And after I ran to import:
mysql -u[user] -h[localhost] -p[pwd] database2 < /home/database1.sql
And I get that message:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘mysql neurocriativi > /home/neurocriativi.sql’ at line 1
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi Nayara,
When dumping your database1 in database1.sql file, you should see a line saying : USE database1
If you want to restore this dump in database2, then you may just comment the line showing the database to use and relaunch your mysql import command again.
Then it should work ^^
Hope this helps
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.