MariaDB wont start - [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
KarlInOz
Starting out
Posts: 11
Joined: Tue Nov 07, 2017 12:03 pm

MariaDB wont start - [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Post by KarlInOz »

OK so for months now I have not been able to get MariaDB to start on our work NAS. I have spent hours and hours looking into it without finding a resolution. I am not sure what events coincided with it failing to work however in the past I have had Odoo installed from the Qnap Club (now uninstalled) and NextCloud installed from Qnap club, also no uninstalled.

Here is what happens when I log in to the NAS via SSH as the admin user. I try starting the db:
[~] # /etc/init.d/mysqld.sh start
..190604 15:32:41 mysqld_safe Logging to '/usr/local/mysql/var/MyProNAS.err'.
190604 15:32:41 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
................................. ERROR!
[~] #
The error log reads:
190604 15:50:50 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
190604 15:50:50 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
190604 15:50:50 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.57-MariaDB) starting as process 9661 ...
190604 15:50:50 InnoDB: The InnoDB memory heap is disabled
190604 15:50:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190604 15:50:50 InnoDB: Compressed tables use zlib 1.2.3
190604 15:50:50 InnoDB: Initializing buffer pool, size = 128.0M
190604 15:50:50 InnoDB: Completed initialization of buffer pool
190604 15:50:50 InnoDB: highest supported file format is Barracuda.
190604 15:50:51 InnoDB: Waiting for the background threads to start
190604 15:50:52 Percona XtraDB (http://www.percona.com) 5.5.55-MariaDB-38.8 started; log sequence number 1597945
190604 15:50:52 [Note] Plugin 'FEEDBACK' is disabled.
190604 15:50:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
190604 15:50:52 [Note] Recovering after a crash using mysql-bin
190604 15:50:52 [Note] Starting crash recovery...
190604 15:50:52 [Note] Crash recovery finished.
190604 15:50:52 [Warning] Failed to setup SSL
190604 15:50:52 [Warning] SSL error: SSL_CTX_set_default_verify_paths failed
190604 15:50:52 [Note] Server socket created on IP: '0.0.0.0'.
190604 15:50:57 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
190604 15:50:57 mysqld_safe mysqld from pid file /var/lock/qmysql.pid ended
The contents of my.cnf are:
[client]
port = 3306
socket = /tmp/mysql.sock

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
default-storage-engine = innodb

ssl-ca=/etc/mysql-ssl/ca-cert.pem
ssl-cert=/etc/mysql-ssl/server-cert.pem
ssl-key=/etc/mysql-ssl/server-key.pem
ssl

log-bin=mysql-bin

binlog_format=mixed

server-id = 1

log-slow-queries
The problem seems to be here:
190604 15:32:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
And of course we have a catch 22 because to fix the problem we have to run mysql_upgrade but to run that we have to start mysql but of course it wont start.
I had hoped that with a firmware update the problem would have self fixed but since I have had the problem I have done at least two updates and the NAS has been restarted several times.

I'm hoping someone may be able to give me a starting point to continue troubleshooting. I would like to be able to uninstall and reinstall MariaDB but I can't find any instructions anywhere on how to do that.
Model:TS-453 Pro
Current firmware version:4.3.6.0993
KarlInOz
Starting out
Posts: 11
Joined: Tue Nov 07, 2017 12:03 pm

Re: MariaDB wont start - [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Post by KarlInOz »

Solved with support from QNAP. They did a malware scan and found an infection in the system. Removed the infection which enabled us to do a firmware update, updated all apps and restarted. MySQL now loads at last.
Model:TS-453 Pro
Current firmware version:4.3.6.0993
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”