Home > database >  The Mysql database remote and local login permissions
The Mysql database remote and local login permissions

Time:09-21

Yesterday just touching mysql login permissions problems in application, this is the local logon permissions not to give, before met remote login access does not give, posted today everybody see,

1, remote login database
Use the root user first login to the database
Perform mysql -u root -p
Enter the password:
To perform the update user set the host='%' where the user='root';
Root of the # # conditions can be modified to want to change user name
Perform flush privileges;
Restart the mysql service can,
2, which gives the user the local login permissions (method a)
Because some may only after the user to create remote login access, on the local host is unable to login to the database, the following method can modify normal users logged in the local authority:
With the first step of the way the login database, perform the following three statements
To grant all privileges on *. * 'user name' @ 'localhost' identified by 'password' with grant option;
Flush privileges;
Service mysqld restart;


Conclusion: more than % of the first approach says that user can login to host the database on any remote address, the same % to localhost can also give the user the local login permissions,

  • Related