using MySQL to import a database is a very unfortunate occurrence:Failed to open file ' Xxx.sql ', Error:2
Do not do anything when this happens, first set the encoding mode set names encoding mode in your MySQL;second, try to import the name of the database should not be Chinese, first change him to English name and then import try. If not, please try the following methods;
The main reason is that MySQL does not have permission to read the permissions that you specify to import the drive letter. So We should now add read access to MySQL
Reprint Please specify Source: http://blog.csdn.net/zch501157081/article/details/51351481
here is a dry:1. Add the MySQL installation path. First right-click My Computer (Wind7 is computer)---> Properties--Advanced system settings, pop up the System Properties interface
2. Click Environment variables to bring up the environment Variables window:
3. find "path" under "System Variables", select Path, click Edit, add MySQL installation path to path, my D:\PHP\wamp\bin\mysql\mysql5.6.17\bin, So add D:\PHP\wamp\bin\mysql\mysql5.6.17\bin at the end of path. Note added before the end of the sentence; , and finally "OK" to save.
OK finish
here is how to import the database in MySQL: 1. Enter the database, set names gbk;//determine the encoding mode 2.use XXX//Select the database you want to import3.source d:\xxx\xxx\xxx;//Your path
The second way:do not enter the database
- Backup:mysqldump-h server address-u login name-P port number-p database name > file name
- Note: Administrator privileges are required;
- Recovery:mysql-h server address-u login name-P port number-p database name < file name
In addition, third-party tools to import the list is not listed here;
Failed to open file MySQL, import MySQL database can not open the solution