I have installed MySQL 8.0.31-1 Ubuntu 22.04 from the MySQL APT repository on a freshly installed Xubuntu 22.04. I am not able to launch MySQL Server. I got the following warnings and errors:
[Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
[System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.31) starting as process 2169
[Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
[Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
[ERROR] [MY-013276] [Server] Failed to set datadir to '/var/lib/mysql/' (OS errno: 13 - Permission denied)
[ERROR] [MY-010119] [Server] Aborting
[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL.
Permissions for /var/lib/mysql/
is drwx------ 7 mysql mysql
I tried setting the datadir to /usr/local/mysql
. I thought I had set the permissions to the same as above. When I ran mysqld --initialize --user=mysql
in a poor attempt to initialize this as the data directory, and I got the following:
[System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.31) initializing of server in progress as process 5588
[ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
[ERROR] [MY-010119] [Server] Aborting
[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.31) MySQL Community Server - GPL.
Am I dealing with a permissions problem? Also, if the datadir is supposed to be /var/lib/mysql/
, where should that be set? Should that be set in /etc/mysql/conf.d/mysql.cnf
? I have run MySQL under Windows 10, and I have used Linux. However, this is my first attempt at using the two together.
Update: I did find datadir = /var/lib/mysql
and it is located in /etc/mysql/mysql.conf.d/mysqld.cnf
. So that looks right. But I am still unsure where the problem is.
Resolution: I was never able to find the problem. Since my system was not 100% configured yet, I simply wiped the drive, installed a fresh system, and then installed MariaDB. I probably should have done that to begin with.