How to upload data?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
einnox
Forum Newbie
Posts: 3
Joined: Sun Dec 01, 2002 11:49 pm
Location: Asia Philippines
Contact:

How to upload data?

Post by einnox »

:roll: This is just an idiot question.. How can i upload data to mySQL tables using FTP?

thanks :(
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Do you want to a) replace files* or to b) add records?
a) they are normal files that can be transfered in binary mode. Shut down mySQLd while uploading the files.
b) afaik there is no direct access to mySQL via FTP, but you might upload a sql-batch-file and execute it in a server's shell.
http://www.mysql.com/doc/en/mysql.html
http://www.mysql.com/doc/en/mysqlimport.html
http://www.mysql.com/doc/en/mysqldump.html
if you have no shell access at the server but can access the database from the internet you can use the mysql-client at your local box to connect to the server and run the batch-file
mysql -hserveraddress -udb_username -ppassword < local-sql-file


*replacing the mysql-files will at least change a whole table
einnox
Forum Newbie
Posts: 3
Joined: Sun Dec 01, 2002 11:49 pm
Location: Asia Philippines
Contact:

How to upload data?

Post by einnox »

all i do is to get or aquired an access to the mySQL server? :oops:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I assume you have an account with php/mysql somewhere?
Most provider (I'm aware of) block direct connections to their mysql-server from outside. But often there is a webtool installed (e.g. myphpadmin) that offers an import feature of some kind. Maybe you should check this first.
If it is not already installed you might do so for your account
einnox
Forum Newbie
Posts: 3
Joined: Sun Dec 01, 2002 11:49 pm
Location: Asia Philippines
Contact:

How to upload data?

Post by einnox »

yes i already seen that tool by tobias.. i also buy his book (php). Anyway, i'll just ask the webhost for the access. Do a client mysql can connect remotely to the webhost?

regards
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

as long as the tcp-port is not blocked
Post Reply