Forum Moderators: phranque

Message Too Old, No Replies

MySQL and phpmyadmin

Remote restore?

         

ahmedtheking

12:55 am on Mar 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possilbe (with phpmyadmin or some sort of query script) to add data into a database?

I know this sounds really stupid and about 1 million people are saying 'just upload it!' well this file is 28mb and phpmyadmin just times out! Ive got it onto my server, is there a way to tell phpmyadmin to grab it from there?!

Or is there a way to run a php script (maybe by loading the file as the query...? i tried, didnt work!) to insert all that data into the DB?

coopster

1:45 am on Mar 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Since you've got the file over to your server, why not use the command line?

[dev.mysql.com...]

ahmedtheking

10:40 am on Mar 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But how would i do that? I havent got root/SSH access!

coopster

11:50 am on Mar 30, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you tried scripting the command? Assign the command to a variable and execute it through a query in a custom script. I'm not familiar with phpMyAdmin, but I would like to believe the interface might offer an option to run the LOAD DATA INFILE statement.

ahmedtheking

12:28 am on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you tell me more?

coopster

1:50 pm on Apr 1, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Well, you obviously have PHP installed on the server, so write yourself a quick script to execute the LOAD DATA INFILE command for you by assigning the statement syntax to a variable, connect to your database and use mysql_query [php.net] to execute the statement.

One caveat may be that your hosting provider doesn't allow you to run that command. I mean, if they don't allow you command line access, they must may have that locked down too. Very restrictive if you ask me. There are a ton of other providers out there that do provide these basic necessities.