I installed MySQL 5.7.26 on Ubuntu 18.04, but cannot login or reset 'root' user password. I tried all the ways from the two top answers to this post, but with no success.
- There is no
/var/log/mysqld.log
file on my machine so I cannot find the temporary password. - Changing the root password with
mysql_secure_installation
does not work. sudo mysqld_safe --skip-grant-tables &
exist immediately.Tried setting the root password with
mysql -u debian-sys-maint -p
, but after I logout and then login back there is stillauth_socket
inMySQL.user
table (for some reasonUPDATE user SET plugin='mysql_native_password' WHERE User='root';
does not take an effect), even if I doflush privileges
andcommit
.
EDIT1:
Also tried this but
sudo su - mysql
mysqld --init-file=/home/me/mysql-init &
exits immediately and in /var/log/mysql/error.log
I have this:
2019-06-12T14:16:16.870292Z 0 [ERROR] Could not create unix socket lock file /var/run/mysqld/mysqld.sock.lock.
2019-06-12T14:16:16.870295Z 0 [ERROR] Unable to setup unix socket lock file.
2019-06-12T14:16:16.870298Z 0 [ERROR] Aborting
directory /var/run/mysqld/
does not exist, but it is created if I do sudo service mysql start
and deleted with I do sudo service mysql stop
The same situation with sudo mysqld_safe --skip-grant-tables &
:
Directory '/var/run/mysqld' for UNIX socket file don't exists.
EDIT2:
Tried on a clean Ubuntu 18.04 installation with the same result and did not find anything with
sudo grep -r 'temporary password' / --include=*.log
I also tried to create the directory as described here (with 'mysql' owner), but got 'permission denied' in logs, with file 'mysql-init' (also with 'mysql' owner').