Jump to content

Mysql dump and import problem


Matthias

Recommended Posts

Hey guys, I've been learning to build websites through w3schools and I've come to my first problem. I am trying to transfer across my sql database to another computer. I believe I have performed the sql dump successfully as I have a small sql file in my bin directory. But when I saved it to disk and inserted into the bin directory on the other computer it doesn't seem to be found. Could someone please confirm that this is the correct syntax to be used: "mysql dump -u [user] -p [password] [db name] < [db name.sql]". Note; i do not use the brackets in the actual syntax. Also does the version of mysql have to be exactly the same for the import to work?

Link to comment
Share on other sites

You can just switch files as you described. You can also export/import your tables with something like phpmyadmin. That's how I prefer to do it.

Edited by niche
  • Like 1
Link to comment
Share on other sites

mysqldump is one word, that's the name of the program, and there should be no space before the password. It considers the space part of the password. You also use ">" to export, "<" is for importing. You can find the reference for the program including all of the available options here: http://dev.mysql.com.../mysqldump.html

You can also export/import your tables with something like phpmyadmin. That's how I prefer to do it.
Guess what phpMyAdmin uses to export databases.
  • Like 2
Link to comment
Share on other sites

If you mean mysqldump, I didn't know that. Thanks for the background jsg.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...