Jump to content


Photo

Execute a *.sql file in the mysql shell


  • Please log in to reply
4 replies to this topic

#1 neugi

neugi
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 21 September 2006 - 07:10 AM

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

#2 neugi

neugi
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 21 September 2006 - 08:33 AM

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:
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    155
Current database: cd1_gmunden

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

best

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 21 September 2006 - 01:24 PM

Strange... and you're doing this locally?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 neugi

neugi
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 21 September 2006 - 04:13 PM

yes, all files are on the server

best

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 September 2006 - 09:56 AM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users