This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

mysql_upgrade -p is failed

Hi Team,

We have installed and configure Mariadb 5.5.56 and migrated dtabase from mysql 5.5.21 after migration mariadb started successfully.

While running mysql_upgrade -p below error is coming.

Phase 4/4: Running 'mysql_fix_privilege_tables' ERROR 1062 (23000) at line 577: Duplicate entry 'tracs_dataf-grmt_updt-PROCEDURE' for key 'PRIMARY' FATAL ERROR: Upgrade failed

Thanks and Regards, Vijay Maurya

Answer Answered by kanika satija in this comment.

When migrating from MySQL to MariaDB, MariaDB has some different definitions for certain privilege tables(proc and event).This means that the structures of some of the MySQL tables are not valid for MariaDB.

Your issue “Phase 4/4: Running 'mysql_fix_privilege_tables' ERROR 1062 (23000) at line 577: Duplicate entry 'tracs_dataf-grmt_updt-PROCEDURE' for key 'PRIMARY' FATAL ERROR: Upgrade failed” is regarding table “mysql.proc”. This table holds stored procedures and stored functions, collectively known as "Stored Routines".

After migration from mysql to mariadb , resolve this issue by following below steps: 1) Take dump of mysql.proctable mysqldump -uroot -p mysql proc > /tmp/mysql-proc.sql

2) Drop proc table

  1. mysql -u root -p mysql MariaDB [mysql]> drop table proc; MariaDB [mysql]>\q 3) Run mysql upgrade mysql_upgrade

4) Restore proc table mysql -uroot -p mysql < /tmp/mysql-proc.sql

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.