0

On Linux Mint, I installed MySQL Server and opted to use a blank password.

This means I can't login to phpMyAdmin, as blank passwords are not accepted.

I can't reset the root MySQL password either, as the blank password is not accepted when running:

mysqladmin -u root -p password newpass

I can't run mysql_secure_installation either as the blank password is not accepted there too.

If I use Software Manager to remove MySQL Server, and then install MySQL Server again, I am not prompted to set up a password.

If I run:

apt-get purge mysql-server mysql-common mysql-client-<version>
rm -rf /var/lib/mysql
rm -rf /etc/mysql*

from this answer, I am still not prompted for a password on installing MySQL Server again.

Help appreciated.

Update

When I run mysql -uroot I receive:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

When I run service mysql start I receive:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
Steve
  • 91
  • 1
  • 10

1 Answers1

2

Login passwordlessly to MySQL via

mysql -uroot

Then change the root password via

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myp4ssw0rd');
FLUSH PRIVILEGES;
dr_
  • 28,763
  • 21
  • 89
  • 133