简体   繁体   English

从phpmyadmin导入sql数据库时出错

[英]Error when importing sql database from phpmyadmin

So, I export an SQL database from another pc that hosts my website(sucessfully appearing the tab of the site that is responsible for the sql table). 因此,我从托管我的网站的另一台PC导出了一个SQL数据库(成功显示了负责sql表的网站的选项卡)。

But on my pc, I cannot get it to work. 但是在我的电脑上,我无法正常工作。 So it got to be a configurations error, something to do with privileges, or the sql database file. 因此,它一定是配置错误,与特权有关的内容或sql数据库文件。

When I import a Database from phpmyadmin for hosting my website I get this error. 当我从phpmyadmin导入数据库来托管我的网站时,出现此错误。

CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

MySQL said: Documentation
#1044 - Access denied for user 'root'@'localhost' to database 'information_schema' 

SO, I go and delete the line 所以,我去删除行

 CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

The DataBases however are being imported and they have the necessary data in them. 但是,正在导入数据库,并且其中包含必需的数据。 But, I go on deleting all the imported Databases except information_schema, phpmyadmin and mysql who I cannot delete. 但是,我继续删除所有导入的数据库,但无法删除information_schema,phpmyadmin和mysql除外。

I load my Database again without this line and this time a get this error : 我再次加载我的数据库而没有此行,这一次出现此错误:

Error

SQL query:

-- --------------------------------------------------------
--
-- Table structure for table `CHARACTER_SETS`
--
CREATE TEMPORARY TABLE `CHARACTER_SETS` (
`CHARACTER_SET_NAME` varchar( 32 ) NOT NULL DEFAULT '',
`DEFAULT_COLLATE_NAME` varchar( 32 ) NOT NULL DEFAULT '',
`DESCRIPTION` varchar( 60 ) NOT NULL DEFAULT '',
`MAXLEN` bigint( 3 ) NOT NULL DEFAULT '0'
) ENGINE = MEMORY DEFAULT CHARSET = utf8;

MySQL said: Documentation
#1044 - Access denied for user 'root'@'localhost' to database 'information_schema' 

THis sql Database is 2.9 MB so in order to import it, I zip it and import it as a compressed .zip file. 该sql数据库的大小为2.9 MB,因此为了导入它,我将其压缩并以压缩的.zip文件形式导入。

This question is a followup from this question, when I realized that my problem is not on the php code as it works on another pc by another person(with whom I do not have contact with). 这个问题是从随访这个问题,当我意识到我的问题是不是在PHP代码,因为它的工作原理是由另一人另一台电脑(我与他没有接触)。

Thanks in advance. 提前致谢。

PS: I performed those as well. PS:我也做了那些。 The problem remains. 问题仍然存在。

mysql> GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

About the "mysql" database, this contains MySQL accounts and privileges information. 关于“ mysql”数据库,它包含MySQL帐户和特权信息。 So you should not import this, however it may contain a MYSQL account necessary for your application. 因此,您不应导入此文件,但是它可能包含您的应用程序必需的MYSQL帐户。 About the "phpmyadmin" database, this contains the phpMyAdmin configuration storage and I suggest to not import it because it's too specific to the original host. 关于“ phpmyadmin”数据库,它包含phpMyAdmin配置存储,我建议不要导入它,因为它对于原始主机来说太具体了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM