Getting error when creating database

Hi,

I am using virtualmin. When I am create a new virtualserver it’s working perfectly without create mysql database. It’s showing the following error.

Creating MySQL login …
… MySQL database failed! : SQL flush privileges failed : Table ‘mysql.servers’ doesn’t exist at …/web-lib-funcs.pl line 1360.

Can you please suggest me. How to resolve the issue

Thanks
Swadesh

Is it possible that your MySQL installation is damaged? “mysql.servers” is a system table and should have been created upon installation of MySQL.

What output do you get if you login to SSH as root, run `mysql -p", enter the root password, and type into the MySQL shell:

select mysql; show tables;

Howdy,

That issue can occur when a large MySQL upgrade takes place (such as when upgrading ones distro, or possibly when manually upgrading to a third party version of MySQL).

You can use the “mysql_fix_privilege_tables” tool to resolve that.

You can see an example of the syntax in this thread here:

http://www.virtualmin.com/node/16485

Some MySQL versions don’t have that program, and instead have a tool named “mysql_upgrade”. You can see an example of the syntax to use for that in this thread:

http://www.virtualmin.com/node/9111