Richard G
Verified User
I think I have to wait until tonight when customers are sleeping and then reinstall mariadb and then restore all databases.
Yeah it's odd. I know loads of people use Debian without any problems. But it started with that odd client line which was required causing the /tmp/mysql.sock issue. After that was clear all import went fine I could do everything.I had zero issues with Debian since version 4
Maybe they were using 127.0.0.1 instead of localhost for the host for SQL....... One actually looks for the socket file, not sure which.... That said, it shouldn't be an OS issue.....Yeah it's odd. I know loads of people use Debian without any problems. But it started with that odd client line which was required causing the /tmp/mysql.sock issue. After that was clear all import went fine I could do everything.
And since yesterday evening suddenly database were working but when a website tried to change anything or create a backup, localhost access was denied again.
This time without any reason, the database was looking for the msyqld.sock in /run/mysqld/ while that directory didn't even exist.
No it worked fine on the old server. As you could see I even couldn't login withMaybe they were using 127.0.0.1 instead of localhost
mysql -u root -p
without the same error or using -h 127.0.0.1
in the commandline.ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)
[mysqld]
socket=/var/lib/mysql/mysql.sock
[client]
socket=/var/lib/mysql/mysql.sock
Oh that's odd. I installed a fresh Almal 8 server yesterday and there it was not an issue, no client line like this needed.I just saw it's happening with a fresh Almalinux / Cloud Linux 9
Yes for root this would work, but he problem is Directadmin is getting the same error about /run/mysqld/mysqld.sock too.Just use:
Yes. It looks like it. Done default by Contabo like this.Is the /var/run/ mounted as tmpfs?
Filesystem Size Used Avail Use% Mounted on
udev 15G 0 15G 0% /dev
tmpfs 3.0G 520K 3.0G 1% /run
/dev/sda3 785G 40G 706G 6% /
tmpfs 15G 0 15G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 147M 1.7G 8% /boot
tmpfs 3.0G 0 3.0G 0% /run/user/0
[mysqld]
socket=/usr/local/mysql/data/mysql.sock
[client]
socket=/usr/local/mysql/data/mysql.sock]
The /var/run/mysqld is created with mysqld's initialize fase when it starts. Thats because of the FHS standard that some dictates that /run/stuff should be deleted and recreated. (IIRC)Which is why I don't understand that the /var/run/mysqld directory will be present (or restored) on Centos and Alma, because there the /run is also mounted on tmpfs.
Oh yes, I could change what I wanted in the my.cnf but nothing helped. So I put it back as how it was from th ebeginning.did you trying config both section "mysqld" and "client" like this
[client]
socket=/usr/local/mysql/data/mysql.sock
Version: '10.5.21-MariaDB-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
mysql 760 0.0 0.4 2195020 136548 ? Ssl 18:36 0:03 /usr/local/mysql/bin/mysqld --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock
Well... not on Debian or at least not on this Debian 11 VPS. I can't check now on the live Centos servers.The /var/run/mysqld is created with mysqld's initialize fase when it starts.
Looks like Debian isn't properly configured to mout the tmpfs while CentOS and AlmaLinux are. On my non-DirectAdmin CentOS or AlmaLinux/Rocky Linux 8/9, there is no /var/run/mysqld as using MariaDB MySQL from official MariaDB YUM repo.Which is why I don't understand that the /var/run/mysqld directory will be present (or restored) on Centos and Alma, because there the /run is also mounted on tmpfs.
echo 'd /run/mysqld/ 0755 root root' > /etc/tmpfiles.d/mysqld.conf
d /run/mysqld/ 0755 root root
You mean /var/run/mysqld because I don't have a /var/mysqld either.there is no /var/mysqld
The tmpfs mount is recreated, that is not the problem.to recreate the tmpfs mount on server reboot,