Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL dump using MySQL Control Centre

Status
Not open for further replies.

cbhead

Technical User
Jul 31, 2002
31
0
0
GB
Does anyone know how how to do an SQL dump of both the structure and data of a database using MySQL control centre.
I need to get all of my database onto another server (both structure and data). I have downloaded My SQL Control Centre and have connected to my database on my local machine but don't know what to do next.
Any ideas would be appreciated.

Thanks.
 
I don't believe that MySQLCC has any menu-driven system for performing that kind of command. That kind of functionality is generally best handled using the mysqldump command that comes bundled with MySQL.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
I don't know if you can. mysqldump is probably the easiest way to do it. Drop to a command prompt and do

mysqldump -uroot -p db {table} >filename

table is optional. This will dump structure and data into filename in the current directory.
 
Thanks for the help so far.
I have tried it but its not working yet.
In the command prompt I typed:

mysqldump -uroot -p db {table} >filename;

I replaced table with the name of my table and filename with my own filename e.g. dump_test.

Is that correct or does -uroot, -p db need to be replaced with anything like password or database name?

Also I presume a file will be created under C: where mysql is or does a file have to be put there before doing this?

I'm think I'm getting close but need a little bit more help.

 
mysqldump -p means it will prompt you for the password. Sorry if i was unclear. db needs to be replaced with database name. if you don't want it to prompt for a password you need:
mysql -uroot -ppassword databasename tablename
you do not need tablename if you want the whole database.
 
I have tried typing:

mysqldump -uroot -ppassword MY DATABASE NAME {MY TABLE NAME} > MY FILENAME;

mysqldump -uroot -pMYPASSWORD MY DATABASE NAME {MY TABLE NAME} > MY FILENAME;

mysqldump -uroot -MYPASSWORD MY DATABASE NAME {MY TABLE NAME} > MY FILENAME;

None have worked so far, I am getting back 'you have an error in your SQL syntax'.
The text in uppercase is where I have entered my own details.
Is there anything obvious that I am not doing?
 
C:\>mysqldump -uroot -p****** mysql
-- MySQL dump 9.09
--
-- Host: localhost Database: mysql
-- ------------------------------------------------------
-- Server version 4.0.16-nt

This is the command I ran to dump out the mysql database. You'll need to replace the stars with your password and mysql with the name of the database you want to dump. Add table names to the end if you wish to dump out tables within the database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top