An error occurred while importing the SQL file from mysql #1044

Source: Internet
Author: User

In my personal knowledge management, I often use mysql databases, wordpress worklogs, search test data, and my blog test environment. I have integrated WAMP (Windows Apache MySQL PHP) on my computer. Haha, instead of LAMP, it is still not smooth to communicate with colleagues around me on the desktop using linux.

I changed my new notebook before December 11. I dumped mysql into an SQL file, more than 50 MB. The result is incorrect when importing data in the new system. An error is returned when the source is executed on the command line:
ERROR 1044 (42000): Access denied for user 'root' @ 'localhost' to database' information _ Scheme'

I have never encountered this problem before. Does the root account have no permissions? It's okay to use the client or phpmyadmin to execute operations. The command line can also execute operations such as creating and deleting databases and tables! After searching for a few items, I couldn't find the problem. I asked a few friends around me and I didn't solve the problem. So I decided to copy the file. After a while, I found that the original dump SQL file contains information about creating and importing information_schema and mysql databases! It turns out that when I dumped all the tables in the database. Obviously, these two databases cannot be imported. Manually use editplus to open the SQL file. After deleting the heap, the import is successful.

I remember that in the era of mysql4, it was okay to do so. I have time to get familiar with it, but I am not able to understand it.

Mysql-u root-p
Enter Password
Source SQL file name

**************************************** **********************

Or, when exporting the SQL file of the database, first select and enter the database, and then select export. This will not include the content of information_schema and mysql databases, when re-importing the SQL file, you must first create the database, then enter the database, and then choose to import the SQL file.

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.