Installation of MySQL 8.0 with Ubuntu 22.04 (jammy)

Bug #1970597 reported by Wolfgang Balzer
6
This bug affects 1 person
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:host=localhost;port=3306;database=mysql, Reason: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
```

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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.