import large MySQL Database - PHPMyAdmin error

2019-03-06 18:47发布

Trying to import a very large database file. Windows Apache PhpMyAdmin.

USE test;
source somefil.sql;

I get a syntax error: "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 'source somefil.sql' at line 1 "

3条回答
趁早两清
2楼-- · 2019-03-06 19:12

There is no such command in mysql server as source. This command is specific to mysql own command line client, which is also named mysql, therefore it is not available in phpmyadmin.

Copy-paste the contents of the sql file into the command window of phpmyadmin and execute its contents directly from there. You may have to increase the php max execution time parameter, if the import file is truly big.

However, I would use the command line client to execute a really big sql file because phpmyadmin is not suitable for that.

查看更多
等我变得足够好
3楼-- · 2019-03-06 19:20

Actually source command is used from command prompt so Use below steps-

Go to command prompt-

connect mysql

now use below command-

source d:/backup/somefil.sql;
查看更多
来,给爷笑一个
4楼-- · 2019-03-06 19:26

to restor backup of my datebase I use command like that from your os command promt :

mysql -u youruser -p yourdatabasename < yourfilewithfullpath.sql

查看更多
登录 后发表回答