# Cannot upgrade MariaDB



## fred974 (Jan 13, 2018)

Hi all,

I used `pkg upgrade` to update my database server from mariadb101-server: 10.1.21 -> 10.1.30.

When I run `mysql_upgrade -u dbadmin -p` I get the following error message:

```
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.gtid_slave_pos
Error    : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status   : Operation failed
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.index_stats                                  OK
mysql.innodb_index_stats
Error    : Table 'mysql.innodb_index_stats' doesn't exist in engine
status   : Operation failed
mysql.innodb_table_stats
Error    : Table 'mysql.innodb_table_stats' doesn't exist in engine
status   : Operation failed
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK

Repairing tables
mysql.gtid_slave_pos
Error    : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status   : Operation failed
mysql.innodb_index_stats
Error    : Table 'mysql.innodb_index_stats' doesn't exist in engine
status   : Operation failed
mysql.innodb_table_stats
Error    : Table 'mysql.innodb_table_stats' doesn't exist in engine
status   : Operation failed
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
mma_staging.mma_affiliate_wp_campaigns
Error    : The user specified as a definer ('mma_live'@'10.8.20.22') does not exist
error    : Corrupt
Phase 4/7: Running 'mysql_fix_privilege_tables'
ERROR 1932 (42S02) at line 585: Table 'mysql.innodb_index_stats' doesn't exist in engine
ERROR 1243 (HY000) at line 586: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1932 (42S02) at line 588: Table 'mysql.innodb_table_stats' doesn't exist in engine
ERROR 1243 (HY000) at line 589: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1932 (42S02) at line 593: Table 'mysql.innodb_index_stats' doesn't exist in engine
ERROR 1932 (42S02) at line 597: Table 'mysql.innodb_table_stats' doesn't exist in engine
ERROR 1932 (42S02) at line 600: Table 'mysql.innodb_table_stats' doesn't exist in engine
FATAL ERROR: Upgrade failed
```
Could someone please help me understand what I did wrong and what I need to do to finish the upgrade properly?

Thank you in advance


----------



## talsamon (Jan 13, 2018)

Maybe, this helps?
https://stackoverflow.com/questions/37856155/mysql-upgrade-failed-innodb-tables-doesnt-exist
Under answer "2" (UPDATED Fix For: MariaDB 10)

Edit: I think you know, but don't forget to backup your database(s) before any action.


----------



## SirDice (Jan 15, 2018)

fred974 said:


> I used  pkg upgrade to update my database server from mariadb101-server: 10.1.21 -> 10.1.30.


You don't need to run mysql_upgrade(1) for patch updates. It's only needed if you upgrade to a new(er) version.


----------



## fred974 (Jan 15, 2018)

SirDice said:


> You don't need to run mysql_upgrade(1) for patch updates. It's only needed if you upgrade to a new(er) version.


Thank yoivery much for informing me.
I was starting to go mad as nothing I tried to far work..I'll let it be then if I don't need to run mysql_upgrade(1)


----------

