Failed to open file MySQL, import MySQL database can not open the solution

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.