Home > database >  MYSQL to access denied for user root @ localhost
MYSQL to access denied for user root @ localhost

Time:10-07

Can I use the command even database, that is, my password is correct, but I used navicat for mysql connection, is an access denied for user root @ localhost

CodePudding user response:

Perform flush privileges; Try again later

CodePudding user response:

I tried this, use the

reference 1st floor ZJCXC response:
perform flush privileges; After try again

CodePudding user response:

1. The remote connection on Linux system, to ensure that the Linux system has been installed on the MySQL database, log in the database, MySQL - uroot - p (password),



2. Create a user to connect remotely
GRANT ALL PRIVILEGES ON *. * TO 'root' @ '%' IDENTIFIED BY '123456' WITH GRANT OPTION;
(the first itoffice said user name, % said all the computer can connect, can also be set up to run a particular IP address connection, the second itoffice said password),



3. Perform flush privileges; Command takes effect immediately



4. Query the database user (see the following content to create a new user successfully)
SELECT DISTINCT CONCAT (' User: "', User, ' ' '@' ' ', the host," '; ') AS the query FROM mysql. The user;



5. Use the exit command exit MySQL
Then open the vim/etc/mysql/my CNF
Will bind - address=127.0.0.1
Set to bind - address=0.0.0.0 address (equipment)
Reboot (command) as follows:
The/etc/init. D/mysql stop
The/etc/init. D/mysql start

CodePudding user response:

Set remote connection means, the host client IP connectivity is remote
  • Related