I've installed MySQL many times without a problem but now I cannot seem to log in to the databases. I created the same users as I always have with the same access and I can access the databases through Webmin but nowhere else whether PHP, PHPMyAdmin, HeidiSQL or other client.
The LAMP stack is on a desktop PC used for Web development and the log at /var/log/mysql/error.log
just shows normal shut downs etc. but nothing else useful. It does have this warning but a password was created for root during installation. root@localhost is created with an empty password ! Please consider switching off the --initialize-inse
(sorry, it goes off the screen where nano can't see it all.)
I then tried to uninstall and purge mysql, then reinstall but also got errors
Uninstalled and purged with:
sudo apt-get remove --purge mysql* -y
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
Reinstalled with:
sudo apt-get -y install mysql-client mysql-server
ERROR: Database files are locked. Daemon already running? Warning:
Unable to start the server. Created symlink
/etc/systemd/system/multi-user.target.wants/mysql.service →
/lib/systemd/system/mysql.service.
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess
returned error exit status 1 dpkg: dependency problems prevent
configuration of mysql-server: mysql-server depends on
mysql-server-8.0; however: Package mysql-server-8.0 is not
configured yet.
dpkg: error processing package mysql-server (--configure): dependency
problems - leaving unconfigured Processing triggers for man-db
(2.11.2-1) ... No apport report written because the error message
indicates its a followup error from a previous failure.
Processing triggers for libc-bin (2.37-0ubuntu2) ... Errors were encountered while processing: mysql-server-8.0
mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)
I have since once again stopped the mysql server, uninstalled and purged it, then reinstalled MySQL and it still gives the same errors. I am unable to log into it in terminal to set a root password. When originally installed, it prompted for it but this time it did not and is apparently running without one.
It gives the same errors as before:
don@Veriton-L480:~$ sudo mysql [sudo] password for don:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)