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!

How to FTP a MySQL database

Status
Not open for further replies.

thrybergh

MIS
Feb 10, 2003
52
GB
Hello.

I am used to using InstantDB with my webapps. After developing my application on my local machine I FTP the java code and database files to my web hosted account.

Will MySQL allow me to do this in the same way? Will it create a directory/file structure that can be FTPed "as is" and do I just need to amend my code to connect to the new physical file location on the web host?

Thanks.
 
It is possible to write files into a MySQL database directory and have MySQL use them. It's one way of backing up and restoring MySQL. Generally, however, the least meddling one does with MySQL's databases, the better. It may be, also, that MySQL's database directories are not accessible to you via FTP.

MySQL is a true database server. There is nearly nothing you can't do through an SQL interface, including bulk loading of data.

I recommend that you export your local data into a CSV file, upload that file to a handy directory on your host's server, then use MySQL's LOAD DATA command to install the data.


Want the best answers? Ask the best questions: TANSTAAFL!!
 
You can use ftp to transfer database files and do backups. This is probably one of my favorite features of the database. Regardless of the platform you are on the files will transfer and work from one server to the next, assuming there are no file size limitations.

Just make sure the mysql server is stopped or you have a lock on the tables before you FTP them. Check out the mysqlhotcopy.pl script. It supports scp if your web host gives you an SSH account.

abombss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top