Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4437

Difficulties getting going with MySQL

$
0
0

I've been using MySQL for years on a Centos VPS, but I've now switched to Ubuntu 22.04.4 and I'm having problems (MySQL 5.7.43).

MySQL installed without problems and runs perfectly well. I can log in via SSH and create a database and a user to have ownership of that database. The new user can log in independently. So as far as I can see everything is working correctly. However, I obviously want to use databases from my websites but when I try to access the new database from a Perl script running on the same server using the new user's login details, it fails with this error:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Obviously I googled this before posting here and there are many references to it, but I couldn't find a single one that helps me.

I followed advice to check that mysql is running (it is), to restart it (done many times), or to alter the location of the sock file in the config files. I found three references to this, two to /var/run/mysqld/mysqld.sock and one to /tmp/mysql.sock, which is the actual location of the mysql sock file. Changing them all to /tmp... makes no difference (the error still points to /var/run...). Changing them all to /var/run... causes mysql to fail to restart.

I don't know if internal socket connections use the same ports, but if they do, port 3306 is open.

So I'm all out of options and beginning to tear my hair out. Incidentally I can't connect from my desktop using HeidiSQL either, which may or may not be the same problem.


Viewing all articles
Browse latest Browse all 4437

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>