Failed to start mysql in 24.10.4

Good afternoon, everyone. I'm new to OpenWrt, but I've managed to install and configure uHTTPD, MySQL, and PHP on OpenWrt 23.05. However, I'm getting an error when starting OpenWrt 24.10.4.

After installing the necessary packages, I configured the php.ini and 50-server.cnf files in the etc/mysql folder.

First, I created the database:

root@OpenWrt:~# mysql_install_db
/usr/bin/mysql_install_db: Deprecated program name. It will be removed in a futu                                                                             re release, use 'mariadb-install-db' instead
WARNING: The host 'OpenWrt' could not be looked up with /usr/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mariadbd, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/mnt/Server/databases/data/mysql' ...
OK

To start mariadbd at boot time you have to copy
support-files/mariadb.service 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 mariadb
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 https://mariadb.com/kb

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mariadbd-safe --datadir='/mnt/Server/databases/data/mysql'

You can test the MariaDB daemon with mariadb-test-run.pl
cd '/usr/' ; perl mariadb-test-run.pl

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

After giving 777 permissions to the created files, I tried to start MySQL, but it throws an error:

root@OpenWrt:~# killall mysqld
root@OpenWrt:~# /etc/init.d/mysqld start
2025-10-29 16:44:08 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32186)
2025-10-29 16:44:08 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
2025-10-29 16:44:08 0 [Note] Starting MariaDB 11.4.8-MariaDB source revision c4ed889b74ed95fa8b4eaf96610d4c1480b346a4 server_uid lgqvZGNXClJkrPMoHn3yQafUfNM= as process 2161
2025-10-29 16:44:08 0 [Note] InnoDB: Compressed tables use zlib 1.3.1
2025-10-29 16:44:08 0 [Note] InnoDB: Number of transaction pools: 1
2025-10-29 16:44:08 0 [Note] InnoDB: Using ARMv8 crc32 instructions
2025-10-29 16:44:08 0 [Note] InnoDB: Using io_uring
2025-10-29 16:44:08 0 [Note] InnoDB: innodb_buffer_pool_size_max=64m, innodb_buffer_pool_size=64m
2025-10-29 16:44:08 0 [Note] InnoDB: Completed initialization of buffer pool
2025-10-29 16:44:08 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)
2025-10-29 16:44:09 0 [Note] InnoDB: End of log at LSN=47629
2025-10-29 16:44:09 0 [Note] InnoDB: Opened 3 undo tablespaces
2025-10-29 16:44:09 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2025-10-29 16:44:09 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2025-10-29 16:44:09 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2025-10-29 16:44:09 0 [Note] InnoDB: log sequence number 47629; transaction id 14
2025-10-29 16:44:09 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/Server/databases/data/mysql/ib_buffer_pool
2025-10-29 16:44:09 0 [Note] Plugin 'wsrep-provider' is disabled.
2025-10-29 16:44:09 0 [Note] InnoDB: Buffer pool(s) load completed at 251029 16:44:09
Failed to start upgrading instance of MariaDB.


root@OpenWrt:~# ps | grep mysql
 2158 root      2256 S    sudo -u mariadb mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock
 2160 root      2252 S    sudo -u mariadb mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock
 2161 mariadb   369m S    mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock
 2258 root      1336 R    grep mysql

After this error, I tried starting the index.php file, but it didn't work. I don't know how to proceed to try to start MariaDB without errors.

Thanks!

You have to use "new" install script https://mariadb.com/docs/server/clients-and-utilities/deployment-tools/mariadb-secure-installation
and the database location should be linux file system, not exfat or ntfs.....

1 Like

Oh! So here's the problem: I have the MySQL server and its database mounted on a partition of an SD card.

But this is new in this version; I've always kept it outside the Linux partition because of its size. Isn't that a step backward?

PD:mariadb-secure-installation not working in openwrt

Sorry - i am talking about file system type like ext3 independent of partitioning.

Ah, okay. The partition where the server and database are located is ext4, so I understand it should work. I don't know where the error is.

It is non-networked mysql as per parameters which means you can connect only to local domain socket...

Okay! Since I'm new to this... does that mean that if I, on my Raspberry Pi 3, extend the root partition where OpenWrt is installed, and create the server and database on this partition, it will work without problems?

As I mentioned before, since OpenWrt 21, I haven't had any problems moving the database to another partition created with a mount point.

Thank!

There is no problem, I think you are looking at no-network temporary DB server used for initial setup.... Just start the server with network port set.

hi,

if you have a powered enough device to run mysql why not run it as a container using docker/podman? probably would mean less headache.

Ugh... I'll try to read and read, but I think I'm too much of a novice to do all this.

By port, are you referring to the configuration in my.cnf or 50-server.cnf? Is there a link or manual I can follow to get the server up and running?

Thanks in advance