Jump to content

Archived

This topic is now archived and is closed to further replies.

neugi

Execute a *.sql file in the mysql shell

Recommended Posts

Hi,

till now i haven't workd with the mySQL Shell, an now i've to import a 400 MB sql file to my database. Is there a way to execute it in the mysql shell?

this one don't worked : LOAD DATA INFILE 'ARTIKEL_akt.sql' INTO TABLE cd1_gmunden.artikel;

thx

Share this post


Link to post
Share on other sites
Hi,

i found out that there are 2 ways:

in the mysql Tool type: SORUCE file.sql
or
mysql -u USER -p PASWWORD DATABASE < file.sql

my problem is now that after a few secounds i get this error:
[code]ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    155
Current database: cd1_gmunden[/code]

only the structure of the table is created, but no data in it.
sql file is generated with phpmyadmin

best

Share this post


Link to post
Share on other sites
Strange... and you're doing this locally?

Share this post


Link to post
Share on other sites
Then I don't see how you can be losing the connection... unless you're sending huge amounts of data all at once, or the server died.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.