I'm setting up a "clean" image for my home Raspberry pi running the latest Raspbian, and I'm finding a small problem when installing the mariadb database.
So far, the steps I've taken are the following:
sudo apt-get install -y mariadb-server
sudo nano /etc/mysql/my.cnf
Add the following lines to my.cnf:
[mysqld]
datadir=/mnt/RaspberryData/mysql
socket=/mnt/RaspberryData/mysql/mysql.sock
[client]
port=3306
socket=/mnt/RaspberryData/mysql/mysql.sock
The path /mnt/RaspberryData/mysql
contains the database info of my previous installation, which was configured through a hard link. This may or may not be the issue.
Then execute:
sudo sytemctl start mariadb
journalctl -u mariadb
And here's when I have the issue:
Jun 22 19:18:33 raspberrypi systemd[1]: Starting MariaDB 10.3.22 database server...
Jun 22 19:18:34 raspberrypi mysqld[2623]: 2020-06-22 19:18:34 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as process 2623 ...
Jun 22 19:18:35 raspberrypi systemd[1]: Started MariaDB 10.3.22 database server.
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: Looking for 'mysql' as: /usr/bin/mysql
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: Version check failed. Got the following error when calling the 'mysql' command line client
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Jun 22 19:18:35 raspberrypi /etc/mysql/debian-start[2662]: FATAL ERROR: Upgrade failed
As you can see, there's some kind of update process that is trying to connect through a socket located in /var/run/mysqld/mysqld.sock
but that path has nothing (Only a mysqld.pid
file).
I'm guessing the guides on how to move the data from one location to another omitted some process or whatnot, as I can actually get into the database and execute queries. So, what am I missing here?
/etc/mysqld/my.cnf
, and it's not being ignored in favor of/etc/my.cnf
?