S
S
Sergey Burduzha2017-09-22 08:13:19
PHP
Sergey Burduzha, 2017-09-22 08:13:19

Why can't phpmyadmin see mysql password?

Installed mysql MariaDb

mysql  Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

When installing phpmyadmin, I enter the password from mysql and at the end I get an error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

It seems that phpmyadmin does not see mysql at all, but I have access to the database through mysql.
True, after installing the database, I could not enter it, it showed that the password was wrong.
I solved the problem in this way
. We find the my.cnf configuration file in the /etc/mysql/ directory, and edit it - add it to the very bottom of the file
[mysqld]
plugin-load-add = auth_socket.so

restarted mysql
sudo mysql -u root
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit

After these steps, I again got access to the database through the previously set password.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Burduzha, 2017-09-22
@serii81

Found a solution, installed mysql and phpmyadmin.
clean removal of mariaDB UBUNTU
(paths and commands may differ for Debian)

sudo apt-get --purge remove mariadb*
sudo apt-get autoremove
sudo apt-get autoclean

if errors occur during deletion -
go to the folder /var/lib/dpkg/info
and delete everything there that starts with mariadb and mysql
, repeat the previous three commands
after it is desirable
sudo apt-get --purge remove mysql*
sudo apt-get autoremove
sudo apt-get autoclean

making sure that there is /var/lib/dpkg/infonothing left in it -
delete the folder /etc/mysql
delete the folder /var/lib/mysqlATTENTION all your databases are stored here so if you need to leave them - rename the folder and after installing mysql copy it to a new one - ONLY those that you created yourself (without system ones)
now do not forget to clean the source of the repository mariaDB that you added when you installed it,
here nano /etc/apt/sources.list
otherwise, when you try to install a pure muscle, you will see how the packages from maria are installed, and you will have to start the removal all over again because you will get an error during installation. :(
before installing MySql do
sudo apt-get update
sudo apt-get upgrade

then, as usual, sudo apt-get install mysql-server
, while the installation may not ask for a password for root, but will pick up the existing
one, you can check the installation with the command
further
sudo apt-get install phpmyadmin(if necessary)
Good luck!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question