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

"dumping" database from my comp to server? do i need inet connection?

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034

i have been developing a site and building the DB on my comp at home. i do not have inet access and choose not to for security reasons. am i able to utilize the dump feature (new to this) still?

would i be able to save (burn) the info to a disk and then use that to perform the DB transfer to the new server? or what would be the workaround, if any...

-g
 
Yes.
Yes.

Dump the database, including the database creation commands, and you should be able to run the resulting script on any other MySQL server of a reasonably similar version.
 
i don't know if you answered my original question, mostly because i'm new to DB'ing.

yes i can dump onto a disk and use the disk to upload to a server?

- g
 
yes

you can do that via mostly any mysql tool like phpMyAdmin, MySQLFront, etc.
the preffered tool is MySQL's mysqldump tool running from the command line.
 
That's right. "Yes" to the first part of your question ("would i be able to save (burn) the info to a disk"). Use the mysqldump command to send the contents of one or more databases to a text file. The file will contain the commands necessary to recreate the database. Use "mysqldump --help" for the options.

For the second part ("and then use that to perform the DB transfer to the new server"), the answer is also "Yes". Use "mysql < dumpfile.txt" using the filename that you created on your own server.

Again, "mysqldump --help" is your friend. The exact syntax for importing depends on how you dumped it to begin with. For example, you can include the commands to recreate the database, or you can just dump the statements to create and add records to tables assuming that the db already exists.

If I was doing it, and I wanted to transfer a database to a server which doesn't already have it, I'd dump it with:

mysqldump --databases <databasename> > dumpfile.txt

and import it on the new server with:

mysql < dumpfile.txt

Adding the username and password as required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top