Jump to content

How to create a dump file


Hobbyist_PHPer

Recommended Posts

MySQL Version --> 5.0.76-standard

 

Hi everyone, I have my first MySQL dedicated server and I'm finding some things to be a bit more challenging than I had expected... I have figured out how to create databases and even how to create a user for that database...

 

But what I need to try to figure out is how to create a dump file of a database, so that I can then use that dump file to recreate all of the tables inside of newly created databases...

 

Here's what I tried for creating a dump file... attorney is the name of the user and the database...

mysqldump -u attorney -p password attorney > acsdumpfile.sql;

 

Here's the error I get...

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 'mysqldump -u attorney -p password attorney > acsdumpfile.sql' at line 1

 

Then I tried doing this instead, copying the contents from one database to a newly created one, that didn't work either...

mysqldump -u attorney -p password -d attorney | mysql -u attorney -p password -d staging;

 

Here's the error I get...

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 'mysqldump -u attorney -p password -d attorney | mysql -u attorney -p passw' at line 1  <-- (I noticed here that it had cut off my password)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.