Why does phpmyadmin give an error when logging in?# 1698 -Access denied for user 'root' @ 'localhost'
... The installation was performed as follows:
sudo tasksel install lamp-server
sudo apt-get install phpmyadmin
Password assigned. OC Linux mint. Tried to enter in the consolemysql -u root -p
After demanded to enter and again gave an error# 1698 -Access denied for user 'root' @ 'localhost'
@AntonVeselov -The tasksel command line utility allows using the menu system to select one or more groups of packages and install them on your Ubuntu system.
titov_andrei2021-09-27 08:00:11-
Answer # 1
Error
Access denied for user 'root' @ 'localhost'
means that the root user with the password you specify does not have access to the DBMS.Apparently the password was not set or was set incorrectly, or instead of 'root' @ 'localhost' the user 'root'@127.0.0.1 was installed. Try typing in the console
mysql -h 127.0.0.1 -u root -p
If after that you are allowed into the DBMS, you need to create an additional user 'root' @ 'localhost'
GRANT ALL ON *. * TO 'root' @ 'localhost' WITH GRANT OPTION IDENTIFIED BY 'password'
If it doesn't, then you need to restore the root password. Find the configuration file my.cnf and add the directive to the [mysqld] section
skip-grant-tables
which will disable access rights checking[mysqld] ... skip-grant-tables
Then restart the server. Now you can login MySQL without password, login and reset password
SET PASSWORD FOR 'root' @ 'localhost'= PASSWORD ('new_password');
After that, remove the directive
skip-grant-tables
from my.cnf and restart the server.It is also worth recalling that the skip grant table must be commented out after setting a new password.
Naumov2021-09-27 03:26:35@Naumov, thanks, completed the answer.
cheops2021-09-27 03:26:35SET PASSWORD FOR 'root' @ 'localhost'= PASSWORD ('root') MySQL response: Documentation # 1290 -The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
Vasily Suricov2021-09-27 09:40:59Where can I find my.cnf config file in Ubuntu?
nick2021-09-27 15:55:23You can focus on table 4.2 at dev.mysql.com/doc/refman/8.0/en/option-files.html MySQL will sequentially poll folders in the order in which they are listed in the table. The file that is found first will be used.
cheops2021-09-27 15:55:23 -
Answer # 2
You just need to enter:
sudo mysql_secure_installation
and answer questions then we log in:
sudo mysql -h localhost -u root -p
-
Answer # 3
in newer versions after MySQL 5.7.6, the password change command is slightly different:
ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'new_password';
- php artisan migrate could not find driver
- php : Data from input is not accepted
- php : How to get the required element from the database?
- php : In Laravel, link three tables. Display characteristics and their values for a product
- PHP + MYSQL. The earlier a match is found in a cell, the higher in the result output
- I can not write a json string as an array to the mysql database via php
- php : Secure MySQL database by encryption?
- php : Laravel DB values output
- php : I can't add the required entry to the database
- javascript : How to store Unix format time in a database
why is this taskset why
Антон Веселов2021-09-27 03:26:35