If for some reason, anyone who is reading is unfortunate enough to have cPanel on some of his servers you have to know that /scripts/mysqlup doesn’t upgrade the mysql database to the new format offered by 5.0.X.
What this means is that, even if you have mysql 5.0.x running, you can not make use of stored procedures or views.

Since we have migrated around 30 servers to mysql 5.0.x I want to share with you how you can fix the problem without even restarting the MySQL:

Here are the queries which will update your mysql database to the new standard for MySQL 5.0.x:

ALTER TABLE mysql.user ADD `Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.user ADD `Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.user ADD `Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.user ADD `Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.user ADD `Create_user_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.user ADD `max_user_connections` int(11) unsigned NOT NULL default 0;

ALTER TABLE mysql.user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv;
ALTER TABLE mysql.user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
ALTER TABLE mysql.user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
ALTER TABLE mysql.user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
ALTER TABLE mysql.user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;

UPDATE mysql.user SET Create_user_priv='Y', Create_view_priv='Y', Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y' WHERE User='root';

ALTER TABLE mysql.host ADD `Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.host ADD `Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.host ADD `Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.host ADD `Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.host ADD `Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N';

ALTER TABLE mysql.db ADD `Create_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.db ADD `Show_view_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.db ADD `Create_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.db ADD `Alter_routine_priv` enum('N','Y') character set utf8 NOT NULL default 'N';
ALTER TABLE mysql.db ADD `Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N';

FLUSH PRIVILEGES;

Keep in mind that you have to use this exact sequence. If you change the order of any of the columns and you will not achieve the desired result. In fact if you change the order of the columns of any of the tables in the mysql database you will probably have big problems, as MySQL is not using column names internally, only column numbers :)


Comments are closed.

Posted by HackMan
Dated: 15th December 2009
Filled Under: Uncategorized