I have openwrt 21 with mysql server provided by maria-db package.
when I run the command /etc/init.d/mysqld restart I get the following erro in result
root: [ERROR] can not detect privileges table, you might need to
root: run 'mysql_install_db --force' to initialize the system tables
when I run mysql_install_db --force then it says
Could not find plugin directory.
Will continue with "/usr/lib/mariadb/plugin".
mysql.user table already exists!
Run mysql_upgrade, not mysql_install_db
and mysql_upgrade will print this error
root@Router:~# mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld.sock' (111)
FATAL ERROR: Upgrade failed
On the other hand If I run mysqld
The mysql server starts
root@OpenWrt:/etc/init.d# ./mysqld start
2022-03-16 16:35:01 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
2022-03-16 16:35:01 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
2022-03-16 16:35:01 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
2022-03-16 16:35:01 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
2022-03-16 16:35:02 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
Could not find plugin directory.
Will continue with "/usr/lib/mariadb/plugin".
Installing MariaDB/MySQL system tables in '/srv/mysql/' ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is root@localhost, it has no password either, but
you need to be the system 'root' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
You can start the MariaDB daemon with:
cd '/usr/' ; /usr//bin/mysqld_safe --datadir='/srv/mysql/'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr//mysql-test' ; perl mysql-test-run.pl
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
root@OpenWrt:/etc/init.d# ps |grep maria
4351 mariadb 337m S /usr/bin/mysqld
4423 root 1096 S grep maria
root@OpenWrt:/etc/init.d#
I tried to remove my modifications of my.cnf and it now starts . The problem now I face is that after every reboot my databases will be deleted . What can be the cause of that
I have identical issue. Installed fresh Openwrt. Installed mariadb and have the same error message while installing.
Errors
2022-08-19 12:21:57 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
After that cannot start it:
root@OpenWrt:~# /etc/init.d/mysqld start
2022-08-19 12:22:50 0 [Warning] Could not open mysql.plugin table. Some options may be missing from the help text
service not enabled in /etc/config/mysqld
I installed it like that several months ago and it worked out of the box.
I reinstalled it several times but with no success.
Trying mysql_install_db --force but it installs the "data" folder within root's home directory.
I tried also mysql_install_db --force --user=mariadb
But then getting:
mysql.user table already exists! Run mysql_upgrade, not mysql_install_db