Debian – Cannot install phptheadmin

aptdebianMySQLphpmyadmin

I cannod install phpmyadmin. The installation process fails with the following error. I can normally log in to the mysql database. What should I do? Normally I would expect "(using password: Yes)". What is making apt to not to bother to give the password?. I am using Debian 9 installation that is pretty fresh and installed on a clean hard drive.

I have copied the innoDB storage from the previous installation and the database has imported these (together with the mysql database)

Additionally AFAIK "dpkg-reconfigure mysql-server" should ask for root password. In my case nothing happens – command quits after one second.

mysql error

Best Answer

I have figured it out.

Solution 1 The trick was: set "SET PASSWORD FOR root@localhost=PASSWORD('')" apparently dbconfig-common works only if the password is empty.

This is related to the contents of "/etc/mysql/debian.cnf" file which in my case had empty password set:

[client]
host     = localhost
user     = root
password =  
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = root
password = 
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

Solution 2

Put the password for the root user into /etc/mysql/debian.cnf

[client]
host     = localhost
user     = root
password = **** password here ***** 
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = root
password = **** password here *****
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr
Related Question