Some more background on what I'm doing. On the Raspberry Pi, here is what I did, logged in as regular user "pi":
sudo apt -y install mariadb-server
sudo apt -y install mariadb-client
sudo service mysqld stop
sudo mysqld --skip-grant-tables &
mysql --user=root < ~/mysql_root_config.sql
kill mysqld
sudo service mysqld start
mysql --user=root -p < ~/sql_user_config.sql
mysql_root_config.sql contains this:
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root' ;
FLUSH PRIVILEGES ;
GRANT ALL ON *.* TO 'root'@'localhost' ;
FLUSH PRIVILEGES ;
SHOW GRANTS FOR 'root'@'localhost' ;
Quit
mysql_user_config.sql contains this:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*418CF519725AAA1BFF555A40A7A6DE18C406B1F2' WITH GRANT OPTION ;
FLUSH PRIVILEGES ;
CREATE USER 'pi'@'localhost' IDENTIFIED BY 'Raspberry' ;
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='pi' ;
FLUSH PRIVILEGES ;
GRANT ALL ON *.* TO 'pi'@'localhost' ;
FLUSH PRIVILEGES ;
GRANT ALL PRIVILEGES ON *.* TO 'pi'@'localhost' IDENTIFIED BY PASSWORD '*418CF519725AAA1BFF555A40A7A6DE18C406B1F2' WITH GRANT OPTION ;
SHOW GRANTS FOR 'pi'@'localhost' ;
CREATE DATABASE qdtimerdata;
USE qdtimerdata
CREATE TABLE timerdata1 (
idx INT(10) NOT NULL AUTO_INCREMENT,
timer_range INT(1) NOT NULL,
timer_lane INT(1) NOT NULL,
match_num INT(11) NOT NULL,
timer_enabled BOOLEAN NOT NULL,
timer_val CHAR(5) NOT NULL,
timestamp TIMESTAMP NULL DEFAULT NOW() ON UPDATE NOW(),
PRIMARY KEY(idx)
) AUTO_INCREMENT=1;
Quit
On the Pi, this all works perfectly every time.
On OpenWRT, I use opkg instead of apt, but the sequence is basically the same. There are no errors during install. I have to manually edit the config file to set enabled='1' (dont have to do that on the Pi), which gets the daemon to run, sometimes, but nothing else works, and, eventually, the daemon starts refusing to load at all. I cannot do the "--skip-grant-tables", because it says mysqld can't be run by root. The root script fails because it says the grants can't be updated. I'', sure I'm just missing one imporant step, but I have no clue what it is, and have been unable to find any documentation that helps me understand how it is supposed to work.
Also, the first time I try to start the daemon after an install, I get all these errors:
2023-02-12 9:39:26 0 [Warning] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some options may be missing from the help text
2023-02-12 9:39:27 0 [Warning] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some options may be missing from the help text
2023-02-12 9:39:27 0 [Warning] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some options may be missing from the help text
2023-02-12 9:39:27 0 [Warning] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some options may be missing from the help text
2023-02-12 9:39:27 0 [Warning] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some options may be missing from the help text
Could not find plugin directory.
Will continue with "/usr/lib/mariadb/plugin".