MySQL upgrade failed during upgrade to Ubuntu 19.10

Asked by Tommy Pollák on 2019-10-31

During upgrade from Ubuntu 19.04 to 19.10 I got an error message that there was a problem with MySQL. However I missed to note what the error was.
Now I can not start the MySQL server:

~$ sudo systemctl start mysql
[sudo] password for tpollak:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
~$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

The socket does not exist:

~$ sudo ls -alF /var/run/mysqld/
total 0
drwxr-xr-x 2 mysql mysql 40 okt 31 21:35 ./
drwxr-xr-x 37 root root 940 okt 31 21:35 ../

I suppose I should make some changes to the MySQL installation but which? To see version of mysqld see last line of snippet:

~$ mysqld
2019-10-31T20:37:33.576631Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2019-10-31T20:37:33.576671Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2019-10-31T20:37:33.576708Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17-0ubuntu2) starting as process 7364
2019-10-31T20:37:33.578558Z 0 [Warning] [MY-010091] [Server] Can't create test file /var/lib/mysql/mysqld_tmp_file_case_insensitive_test.lower-test
2019-10-31T20:37:33.578565Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2019-10-31T20:37:33.578940Z 0 [Warning] [MY-010122] [Server] One can only use the --user switch if running as root
2019-10-31T20:37:33.578952Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/var/lib/mysql/' (OS errno: 13 - Permission denied)
2019-10-31T20:37:33.579036Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-31T20:37:33.579130Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17-0ubuntu2) (Ubuntu).

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Tommy Pollák
Last query:
Last reply:
Tommy Pollák (tommy.pollak) said : #2

Sorry, id did not help.
However, the problem is solved. I do not know, but after a time I checked mysqld again and it worked. Probably one of the updates fixed it.

Likely, the release is not stable

It's a pre-release. What did you expect...........