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.
  • What is the output of systemctl status mysql.service and journalctl -xe? – dr01 Jun 3 '18 at 10:49
1

Login passwordlessly to MySQL via

mysql -uroot

Then change the root password via

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myp4ssw0rd');
FLUSH PRIVILEGES;
  • Thanks dr01, see the update to my question please. – Steve Jun 2 '18 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.