T
T
Twelfth Doctor2017-01-21 18:37:11
linux
Twelfth Doctor, 2017-01-21 18:37:11

Why can't login as MySQL root user in PHPMyAdmin?

Hello! For some reason I can't login as MySQL root user through phpMyAdmin.
Through the console I checked, I enter absolutely fine. Gives error #1698 - Access denied for user 'root'@'localhost' Unable
to log in as other users. What could be the reason?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
U
ussrkiev, 2018-01-17
@ussrkiev

MySQL 5.7 has changed the security model: now logging into MySQL as root requires sudo
https://www.ussr.kiev.ua/ru/1698-Access-denied-for-user

T
TyzhSysAdmin, 2017-01-21
@POS_troi

1. root passwords must be set
2. $cfg['Servers'][$i]['AllowRoot'] must not be false

E
Egor, 2018-01-30
@Softwider

Solution:
mysql -u root -p
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit;
systemctl start mariadb
systemctl start mysql

B
blackfox24, 2020-02-21
@blackfox24

A proven working option, I think it will help:
By default, root login is prohibited. I advise you to create a separate user for your needs:
(enter one line at a time)
sudo mysql -u root -p (will ask for a password)
create user 'user'@localhost identified by 'password';
grant all privileges on *.* to 'user'@localhost;
grant grant option on *.* to 'user'@localhost;
flush privileges;
stop;
How to login as root in phpmyadmin?

E
Eugene Volf, 2017-01-21
@Wolfnsex

Perhaps in the fact that acc. there is no entry permitting entry in the database. You can try to run the mysql-client from under the root (in the console). This approach works with MariaDB, it might work with MySQL too.
And then see who can log in from which host. Base: mysql , table: user . Example .

I
Ilya Bobkov, 2017-01-21
@heksen

And you didn’t crash the root user in PhpMyAdmin?

V
Victor Taran, 2017-01-24
@shambler81

Indeed, how to log in as root without a password has already been sucked up many times and this can be easily found on the Internet.
This is a limitation in the config.

V
Vladimir Eliseev, 2020-05-31
@progreccor

https://mariadb.org/authentication-in-mariadb-10-4/
why this is done is described in this article

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question