SQL 错误 #1044 - 用户 'root'@'localhost' 对数据库 'information_schema' 的访问被拒绝
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4824986/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error #1044 - Access denied for user 'root'@'localhost' to database 'information_schema'
提问by JonYork
Alright, so here is the scenario
好的,这里是场景
I performed a full backup on my mysql server today. Now when I try to import that .sql dump file, I get the error mentioned in the title and it does not load all the other databases.
我今天在我的 mysql 服务器上执行了完整备份。现在,当我尝试导入该 .sql 转储文件时,出现标题中提到的错误,并且它没有加载所有其他数据库。
How can I get around this so phymyadmin will allow me to import the whole file, or is there a way I could "remove" information_schema from the sql dump
我怎样才能解决这个问题,以便 phymyadmin 允许我导入整个文件,或者有什么方法可以从 sql 转储中“删除”information_schema
Thanks
谢谢
采纳答案by JonYork
As Dan Grossman said:
正如丹·格罗斯曼所说:
To "remove" information_schema from the dump, open the file in notepad and delete those lines. It's just a text file of sequential queries to run.
要从转储中“删除”information_schema,请在记事本中打开该文件并删除这些行。它只是一个要运行的顺序查询的文本文件。
回答by Tom
Open information_schema and run
打开 information_schema 并运行
FLUSH TABLES
This should clear the information_schema CACHE and will stop the error as it "resyncs" the tables to the latest schema
这应该清除 information_schema CACHE 并将停止错误,因为它将表“重新同步”到最新的模式
回答by mario
I use a program called Notepad++.
我使用一个名为 Notepad++ 的程序。
You open your sql file and the program will put it in a way where you can clearly see what the information_schema database is trying to do and why it is failing every time. You can safely remove that part of the database.
你打开你的 sql 文件,程序会把它放在一个你可以清楚地看到 information_schema 数据库试图做什么以及为什么它每次都失败的地方。您可以安全地删除数据库的那部分。
Then I install a WAMP on my pc, run a mysql program (mysql front) and import the database. After importing I have full access to the tables and databases.
然后我在我的电脑上安装一个 WAMP,运行一个 mysql 程序(mysql 前端)并导入数据库。导入后,我可以完全访问表和数据库。
Just export what you want and then just import then to your new database.
只需导出您想要的内容,然后将其导入到您的新数据库中。
回答by shahbaz ali
CREATE a new database and then then try to connect using that new db then run the schema and then try to execute the databases.
创建一个新数据库,然后尝试使用该新数据库进行连接,然后运行架构,然后尝试执行数据库。