{"id":1048,"date":"2010-08-21T09:08:47","date_gmt":"2010-08-21T13:08:47","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1048"},"modified":"2013-03-20T08:43:16","modified_gmt":"2013-03-20T12:43:16","slug":"problem-adding-a-database-user-in-plesk-or-restarting-mysql-table-mysql-servers-doesnt-exist","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/problem-adding-a-database-user-in-plesk-or-restarting-mysql-table-mysql-servers-doesnt-exist","title":{"rendered":"Table mysql.servers doesn&#8217;t exist: Problem adding a database user in plesk Or restarting mysql"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline; color: #0000ff;\"><strong>Update:<\/strong><\/span> <strong>If &#8220;mysql_fix_privilege_tables&#8221; command does not exist, look at Section 2.<\/strong><\/p>\n<p>You may receive a &#8220;Table &#8216;mysql.servers&#8217; doesn&#8217;t exist&#8221; error message while adding a database user in Plesk OR while restarting the Mysql service. The complete error message look like:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">Error: Connection to the database server has failed: <\/span>\r\n<span style=\"color: #0000ff;\">Table 'mysql.servers' doesn't exist<\/span><\/pre>\n<\/blockquote>\n<p><strong>OR<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">Can't open and lock privilege tables: <\/span>\r\n<span style=\"color: #0000ff;\">Table 'mysql.servers' doesn't exist<\/span><\/pre>\n<\/blockquote>\n<p>The problem mostly occurs when Mysql is upgraded which introduce newer version of tables and the default Mysql database is not aware of these changes. The &#8220;mysql_fix_privilege_tables&#8221; command is use to update the Mysql database with the latest contents of the newer version and to fix the privileges of the database users as well.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Section 1:<\/strong><\/span><\/p>\n<p>To fix the issue, SSH to your server and execute:<\/p>\n<p><strong>On a plain Linux OR Linux\/cPanel server:<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysql_fix_privilege_tables --user=root<\/span>\\\r\n <span style=\"color: #0000ff;\">--password=mysqlpasswordhere --verbose<\/span><\/pre>\n<\/blockquote>\n<p><strong>On a Linux\/Plesk server:<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysql_fix_privilege_tables --user=admin\\<\/span>\r\n <span style=\"color: #0000ff;\">--password=`cat \/etc\/psa\/.psa.shadow` --verbose<\/span><\/pre>\n<\/blockquote>\n<p>where, &#8211;verbose will display the detailed output.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Section 2:<\/strong><\/span><\/p>\n<p><strong>mysql_upgrade<\/strong> command have superseded mysql_fix_privilege_tables. mysql_fix_privilege_tables is an older script that previously was used to upgrade the system tables in the Mysql database .<\/p>\n<p>To fix the issue, you need to replace <strong>mysql_fix_privilege_tables <\/strong>with <strong>mysql_upgrade <\/strong>in the above stated commands, i.e.<\/p>\n<p><strong>On a plain Linux OR Linux\/cPanel server:<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysql_upgrade --user=root --password=mysqlpasswordhere --verbose<\/span><\/pre>\n<\/blockquote>\n<p><strong>On a Linux\/Plesk server:<\/strong><\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># mysql_upgrade --user=admin\\<\/span>\r\n <span style=\"color: #0000ff;\"> --password=`cat \/etc\/psa\/.psa.shadow` --verbose<\/span><\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<br \/>\nUpdate: If &#8220;mysql_fix_privilege_tables&#8221; command does not exist, look at Section 2.<br \/>\nYou may receive a &#8220;Table &#8216;mysql.servers&#8217; doesn&#8217;t exist&#8221; error message while adding a database user in Plesk OR while restarting the Mysql service. The complete error message look like:<\/p>\n<p>Error: Connection to the database server has failed:<br \/>\nTable &#8216;mysql.servers&#8217; doesn&#8217;t exist<\/p>\n<p>OR<\/p>\n<p>Can&#8217;t open and lock privilege tables:<br \/>\nTable &#8216;mysql.servers&#8217; doesn&#8217;t exist<\/p>\n<p>The problem mostly occurs when Mysql is upgraded which introduce newer version of tables and the default Mysql database is not aware of these changes. The &#8220;mysql_fix_privilege_tables&#8221; command is use [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1036,1040,1041,1039,1330,1037,1035,1034],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1048"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1048"}],"version-history":[{"count":25,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1048\/revisions"}],"predecessor-version":[{"id":2225,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1048\/revisions\/2225"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}