Error Table 'mysql.servers' doesn't exist
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.
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.
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开发者_JS百科 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)
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:
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.
This error can sometimes appear after a new installation of MySQL when the mysql table does not get created properly. Running the command...
mysql_install_db --user=mysql
from the bash prompt (not the MySQL prompt) will install the table and get things working.
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.
These commands are for Linux, they may not work on Windows but there are corresponding commands if you search the MySQL docs.
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.
Found the following when attempting to upgrade. Was directed to the following page: 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"
It looks like your user does not have access to the mysql
database. You may want to grant the SELECT
command as follows:
GRANT SELECT ON mysql.* TO 'your-user'@'localhost';
In my case show tables
in mysql
database identifies servers
table exists, but yet I got the Error Table 'mysql.servers' doesn't exist
error.
Listing <data-dir>/mysql
directory revealed servers.frm
file exists, but relative servers.MYI
and servers.MYD
files were missing - maybe I played a role on that!
Anyhow knowing that I'm using the server as an intermediate server in a Daisy Chain Replication
, I got a backup from servers.frm
file and recreated the table by running the @timo-huovinen's answer things got back to normal.
It's noteworthy that there was at least one other table (plugin
) missing MYI
and MYD
files.
精彩评论