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!

FTP MySQL database? 1

Status
Not open for further replies.

Elliott3

Programmer
Sep 5, 2002
347
CA
Hi,

I am new to MySQL/PHP and have just finished transcribing a site. I have no idea where to start when it comes to uploading a MySQL database. Can anyone push me in the right direction?

CES
 
I have converted a site from MS Access/ASP to MySQL/PHP. I have already converted the .mdb to a MySQL database. How do I go about getting my database to the server? I can upload the PHP files to the site but dont know what to do with the MySQL database. Until now I have been doing all the testing of the site on my local machine.

CES
 
Do the OSes of the development machine and the production machine match?

Since MySQL stores a database in a directory and tables in sets of files, it's possible to create a database on the destination server then copy the table files from the source server into the destination server's database's directory. But this does not work well if, for example, the source database is Win32 and the destination database is a unix-like OS.

Barring that, you can use something like mysqldump to dump a database into a set of SQL commands that will create and populate the database and tables.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Yes, the site was actually developed on a windows based system and the server is apache running on linux. So what would you suggest?

CES
 
ok.
so i have created the .sql file. I thought I would try to put it into my local machine as a new database just to try it. However, I am unable to get it to work. I keep getting a syntax error. Any thoughts as to what I am doing wrong?

CES

By the way, thanks for all your help thus far. You have posted to a number of my threads as i began learning MySQL/PHP two weeks ago.

Thanks!
 
Can you tell me where I can find some documentation on putting the .sql file into a database? I found this : and it says to: mysql database < backup-file.sql to read into the database but it doesnt seem to work for me..I assume that 'database' is the destination database and 'backup-file.sql' is my dump file..any idea..

CES
 
The easiest way i did mine (I had to do the exact same thing)... I uploaded PHPMYADMIN onto the server and i used it to upload the new database since I didn't have access to the data folder where all the databases are stored.
 
HondaSir..
I just uploaded phpmyadmin to my server. In the config.inc.php, I need to change the localhost, Database user and the password...is that all?

CES
 
You can feed your .sql file to mysql like this:
Code:
mysql < file.sql
I tried phpMyAdmin for this, but the .sql file was apparently bigger than some setting (probably either php.ini or system user limits) allowed. It would upload for a minute, then give a 'no sql query' error.

Handy tool link:
It dumps all your Access tables at once into a .sql file. Handy for me anyway, and it's free.

----
JBR
 
Ya,
I had the same problem....but i copied and pated one table at a time and it worked 'on my local machine'. I cant seem to get it to work on the server. I am open to suggestions about that. Can i do it your way flugh even if i do not own the server? if so, please explain.

All suggestions welcome!

CES
 
I have SELECT, INSERT, UPDATE, DELETE, CREATE, DROP privileges in the MySQL priv table (no ALTER, a bigger pain than I anticipated when sending my support request email :)). Works like a champ for me, just CREATE a blank database, then do the 'mysql < file.sql' thing.

----
JBR
 
but how do i get to the mysql prompt on the server?

CES
 
From the commandline on the server box:
mysql < file.sql

'mysql' is the mysql client.

I am assuming you have shell access to the remote, mysql server-hosting box though (via ssh, telnet, whatever). Sorry if I am mistaken.

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top