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

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2019-10-31
Last reply:
2019-11-01

Can you help with this problem?

Provide an answer of your own, or ask Tommy Pollák for more information if necessary.

To post a message you must log in.