使用 phpmyadmin 将大型数据库导入 mysql 的简单方法是什么?
我需要导入一个大约 120M 的数据库(sql 文件),但是在 phpmyAdmin 中,不允许导入超过 8MB.
I need to import an database(sql file) which is about 120M is size, but in phpmyAdmin, it is not allowed to import more than 8 MB.
如何解决这个问题?
推荐答案
IIRC PHPMyAdmin 和 MySQL 都没有限制 - 限制是 POST 大小(网络服务器配置)或文件上传大小(php.ini)).如果您不能更改其中任何一个,那么您需要通过其他方式上传文件,然后....
IIRC there is no limit in PHPMyAdmin nor is there in MySQL - the limit is on the POST size (webserver config) or the file upload size (php.ini). If you can't change either of these, then you'll need to upload the file by other means then ....
mysql -u username -p <mysql_export_file.sql
如果你不能上传文件/没有shell访问权限/没有可用的mysql客户端的CLI版本,那么接下来要尝试的是看看你是否可以使用mysql CLI客户端进行远程连接:
If you can't upload files / have no shell access / have no CLI version of the mysql client avaialable, then the next thing to try is to see whether you can connect remotely using the mysql CLI client:
mysql -u username -h www.example.com -p
如果连接正常,则退出并在导出的文件中再次运行它
If this connects OK, then exit and run it again piping in the exported file
mysql -u username -h www.example.com -p <mysql_export_file.sql
如果这不起作用,那么您需要将导出文件拆分为多个较小的块,或者编写自己的数据加载器来传输数据.
If that doesn't work then you'll need to either split the export file into multiple smaller chunks or write your own dataloader which trickles the data.
C.
相关文章