错误表“mysql.servers”不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3653021/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 17:04:47  来源:igfitidea点击:

Error Table 'mysql.servers' doesn't exist

mysqlplesk

提问by Timo Huovinen

I get the error "Table 'mysql.servers' doesn't exist" from plesk when I try to create a new database user, the created user does not show up anywhere but the name is still reserved, and it does not allow me to access the database.

当我尝试创建一个新的数据库用户时,我从 plesk 收到错误“表 'mysql.servers' 不存在”,创建的用户没有出现在任何地方,但名称仍然保留,它不允许我访问数据库。

edit:I was unable to login to phpMyAdmin to this webserver, so instead I managed to login to it through a different domain, and it tells me a notice: Your PHP MySQL library version 5.0.90 differs from your MySQL server version 5.1.49. This may cause unpredictable behavior.

编辑:我无法将 phpMyAdmin 登录到这个网络服务器,所以我设法通过不同的域登录它,它告诉我一个通知:您的 PHP MySQL 库版本 5.0.90 与您的 MySQL 服务器版本 5.1.49 不同. 这可能会导致不可预测的行为。

edit:manually installed phpmyadmin then manually installed libmcrypt (which is an accomplishment with my cruddy sever skills :D) so that phpmyadmin works. Then accidentally found out how to login as root via plesk (the trick is to enter webadmin without choosing any database), at least I think it's root :S ran the sql: GRANT SELECT ON mysql.* TO 'my-user'@'localhost'; with a success message went back to plesk to see if I can manage the sql with "my-user" and no, its still missing from the available users, but the name is still reserved... tried to run: mysql_fix_privilege_tables –user=root –password=mypasswordobviosuly –verbose but gave and error, and i'm still not sure how to run direct mysql commmands without using ssh (because i dont know the root password)

编辑:手动安装 phpmyadmin 然后手动安装 libmcrypt(这是我的 cruddy sever 技能的成就:D),以便 phpmyadmin 工作。然后偶然发现了如何通过 plesk 以 root 身份登录(诀窍是在不选择任何数据库的情况下进入 webadmin),至少我认为它是 root :S 运行了 sql: GRANT SELECT ON mysql.* TO 'my-user'@'本地主机'; 有一条成功消息返回plesk,看看我是否可以使用“my-user”管理sql,不,可用用户仍然缺少它,但名称仍然保留...尝试运行:mysql_fix_privilege_tables –user= root –password=mypasswordobviosuly –verbose 但给出了错误,我仍然不确定如何在不使用 ssh 的情况下直接运行 mysql 命令(因为我不知道 root 密码)

采纳答案by kc2keo

Found the following when attempting to upgrade. Was directed to the following page: http://kb.parallels.com/en/112290

尝试升级时发现以下内容。被定向到以下页面:http: //kb.parallels.com/en/112290

I ran the following from that page:

我从该页面运行以下内容:

"Run the following command for repairing MySQL table:
#mysql_upgrade -T --debug-check -u admin -p`cat /etc/psa/.psa.shadow` mysql"

“运行以下命令修复 MySQL 表:
#mysql_upgrade -T --debug-check -u admin -p`cat /etc/psa/.psa.shadow` mysql”

回答by Timo Huovinen

I entered mysql via pre-installed phpmyadmin as 'root' like so: (in plesk) home-> database servers -> webadmin. Then choose the "mysql" database, if the table 'servers' is missing (probably some mysql bug) then it will need to be created: choose 'SQL' in 'phpmyadmin' to and run the following sql:

我通过预先安装的 phpmyadmin 以“root”身份输入 mysql,如下所示:(在 plesk 中)home-> 数据库服务器-> webadmin。然后选择“mysql”数据库,如果缺少表“servers”(可能是一些mysql错误),则需要创建它:在“phpmyadmin”中选择“SQL”并运行以下sql:

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';

so that the table at least exists... then create a new user in plesk, and viola! it works! I was able to login as the user I created after that, it seems like it was some bug with some mysql update I did not even know about.

这样表至少存在......然后在plesk和中提琴中创建一个新用户!有用!我能够以我之后创建的用户身份登录,这似乎是一些我什至不知道的 mysql 更新的错误。

回答by Night Owl

This error can sometimes appear after a new installation of MySQL when the mysql table does not get created properly. Running the command...

当 mysql 表未正确创建时,有时会在新安装 MySQL 后出现此错误。运行命令...

mysql_install_db --user=mysql

from the bash prompt (not the MySQL prompt) will install the table and get things working.

从 bash 提示符(不是 MySQL 提示符)将安装该表并使其正常工作。

After running the command above on a new installation the following command will help secure the install...

在新安装上运行上述命令后,以下命令将有助于保护安装...

mysql_secure_installation

This will prompt you to enter a root password, remove anonymous access, limit root access to localhost only and remove the test database.

这将提示您输入 root 密码、删除匿名访问、将 root 访问限制为 localhost 并删除测试数据库。

These commands are for Linux, they may not work on Windows but there are corresponding commands if you search the MySQL docs.

这些命令适用于 Linux,它们可能不适用于 Windows,但如果您搜索 MySQL 文档,则有相应的命令。

This is not related to the Plesk issue of the original poster but I stumbled upon this question while researching a MySQL installation problem and thought this might help save someone some time.

这与原始海报的 Plesk 问题无关,但我在研究 MySQL 安装问题时偶然发现了这个问题,并认为这可能有助于节省一些时间。

回答by Daniel Vassallo

It looks like your user does not have access to the mysqldatabase. You may want to grant the SELECTcommand as follows:

您的用户似乎无权访问mysql数据库。您可能希望SELECT按如下方式授予命令:

GRANT SELECT ON mysql.* TO 'your-user'@'localhost';

回答by hpaknia

In my case show tablesin mysqldatabase identifies serverstable exists, but yet I got the Error Table 'mysql.servers' doesn't existerror.

在我的情况下show tablesmysql数据库标识servers表存在,但我收到了Error Table 'mysql.servers' doesn't exist错误。

Listing <data-dir>/mysqldirectory revealed servers.frmfile exists, but relative servers.MYIand servers.MYDfiles were missing - maybe I played a role on that!

列出<data-dir>/mysql目录显示servers.frm文件存在,但相关文件servers.MYIservers.MYD文件丢失 - 也许我在这方面发挥了作用!

Anyhow knowing that I'm using the server as an intermediate server in a Daisy Chain Replication, I got a backup from servers.frmfile and recreated the table by running the @timo-huovinen's answer things got back to normal.

总之知道我使用的服务器作为一个中间服务器Daisy Chain Replication,我接到了一个备份servers.frm文件,并通过运行@蒂莫- huovinen的回答事情就恢复正常重新创建表。

It's noteworthy that there was at least one other table (plugin) missing MYIand MYDfiles.

值得注意的是,至少有一个其他表 ( plugin) 丢失MYIMYD文件。