-1

I want to import a 600mb .sql file into phpMyAdmin. As I have memory limitation in server, I can't use import option given in phpMyAdmin.

halfer
  • 19,471
  • 17
  • 87
  • 173
Anurag Prashant
  • 906
  • 10
  • 30
  • you cant do that in phpmyadmin however in mysql cli you can do so. – Abhik Chakraborty Jun 04 '14 at 09:39
  • This is a duplicate of http://stackoverflow.com/questions/15278375/importing-larger-sql-files-into-mysql – Dom Jun 04 '14 at 09:45
  • I'm getting this error `#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u –-password= < newmagdb.sql' at line 1` – Anurag Prashant Jun 04 '14 at 10:55

4 Answers4

1
mysql -u username –-password=password database_name < file.sql

If it's not clear, look for how to load from a dump file.

Goon10
  • 140
  • 4
0
mysql -u [username] -p [dbname] < [path for the sql file to be imported]

You can use this in mysql command prompt.

prava
  • 3,698
  • 2
  • 21
  • 34
0

PHPMyAdmin Can only do this if the server settings are sufficiently generous to allow you to upload such a large file.

If you have command line client then you should use the mysql client. If you don't have command line access then MySQLDumper is a very good tool for importing large SQL files.

Dom
  • 2,708
  • 2
  • 24
  • 37
0

If you have memory limitations in the server and you are using phpmyadmin, you have to manually split the sql file or use a tool to split the file based on your memory restrictions and import file by file.

DC-
  • 801
  • 9
  • 14