Installation of MySQL 8.0 with Ubuntu 22.04 (jammy)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman MySQL UDF |
New
|
Undecided
|
Unassigned |
Bug Description
I was building a docker container with Ubuntu 22.04 including MySQL 8.0 yesterday. At first everything was fine, the containers bash shell runs as root and I could connect to the database via the mysql command.
But then I was running a CGI script via the Apache web server running with user www-data, I received the following error message in the Apache logs:
```
Can't connect to database, DBI:mysql:
```
Important to note is the 13 at end of the error message, it means: "Permission denied". Normally it is 2 for "File or directory not found" when to database is not running.
It took me some time to find that the directory /var/run/mysqld has a permission of:
```
drwx------ 1 mysql mysql 4096 Apr 26 06:52 mysqld
```
Nobody else then root can reach the socket file to access the database. After changing the directory permissions to 0755 everything works fine. Please repair this.
tags: | added: 22.04 mysql permissions |
tags: | removed: mysql permissions |
tags: | added: mysql permissions |