Page 1 of 1

running a sql file

Posted: Sat Apr 01, 2006 2:42 pm
by psychotomus
i have 2 files called mysql_schema.sql and postgres.sql. how can I execute these files??

Posted: Sat Apr 01, 2006 3:15 pm
by s.dot
i believe from the command line

using

Code: Select all

MySQL> \. /path/to/dump.sql
or using phpmyadmin for mysql, click on the sql tab, and upload your dump

use the mysql command

Posted: Sun Apr 02, 2006 1:12 am
by dibyendrah
use the following command :

Code: Select all

$mysql database_name < /path/to/mysql_schema.sql
Dibyendra

Posted: Sun Apr 02, 2006 2:53 pm
by Ambush Commander
I think the question is how to execute them from a PHP script. (actually, I'd like to know too. It seems that a one statement per query rule is enforced)

Posted: Sun Apr 02, 2006 3:20 pm
by sheila
viewtopic.php?t=46444
where $command and $arguments are what you would use on the command line

or

Read the whole sql file into a variable. Split it on ';' and send each command to the server one at a time.
You might need to do some additional work to remove comments from the sql file.

MYSQL ERROR #28

Posted: Sun Apr 02, 2006 9:43 pm
by Deseree
Guys, my code was working just fine, but now it's not.... uhm... the only thing that has changed is I'm adding 3.5 million rows of data (short) into the mysql table....
MYSQL ERROR:Got error 28 from table handler
Is that too much data or why am I getting this error?

Re: MYSQL ERROR #28

Posted: Sun Apr 02, 2006 10:35 pm
by John Cartwright
Deseree wrote:Guys, my code was working just fine, but now it's not.... uhm... the only thing that has changed is I'm adding 3.5 million rows of data (short) into the mysql table....
MYSQL ERROR:Got error 28 from table handler
Is that too much data or why am I getting this error?
Threadjacking is not cool.

Posted: Sun Apr 02, 2006 10:37 pm
by Ambush Commander
(pardon me but...) for a moment I thought you were talking about multithreading (then I checked the poster)