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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL dump to host 1

Status
Not open for further replies.

LTeeple

Programmer
Aug 21, 2002
362
CA
Hello all...

I have a test mysql server, and have built a database that I would like to dump to my web host.

I am inputting the command:
$ mysqldump -u user -p password --databases databasename | mysql -u user -p password --host=host.com -C newDatabasename

Could someone confirm the following for me?
1) newDatabasename must already be created on host
2) In order to accomplish this, user must have sufficient rights on the host mysql server

Once the command is successfully completed, is there any indication that it has? Will newDatabase name appear in the mysql folder on the host? Do I need to 'undump' the newDatabase, or is it ready to use?

Thanks all, for your help!

[cheers]
Cheers!
Laura
 
I hope the following is right:

mysqldump does not include database creation statements, so the database on the destination host must already be created. You can do this by:
[tt]mysql -u user -p password -h host.com <[/tt]filename
where filename contains the result of:
[tt]SHOW CREATE DATABASE dbname;[/tt]

To create a database on a server, you must have the CREATE privilege. To create tables and load data, the user must have the CREATE, INSERT, INDEX privileges. Default user privileges would include these.

When the database has been created, the database will appear as a directory within the MySQL data directory. When the tables have been created, a set of tablename.frm files will have been created. When the data has been loaded, you may be able to tell that from the sizes of the data files, depending on the table type used by the database.
 
... and, about "undumping" the new database, no you won't need to, you can use it immediately.
 
Tony, thanks so much, you answered all my questions.

[cheers]
Cheers!
Laura
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top