1. Initialize root password
Go to MySQL Database
|
mysql>updateuser setpassword=PASSWORD(‘123456’) whereUser=‘root‘; |
To allow MySQL remote access, you can use the following three ways:
A, change the table.
| 1234 |
mysql-u root–p mysql>use MySQL; MYSQL> update user set host = where user =  MYSQL> select HOST,  user from User |
b, Authorization.
For example, you want to use root 123456 from any host to connect to the MySQL server.
|
mysql>GRANTALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIEDBY ‘123456‘ WITH GRANTOPTION; |
If you want to allow the user jack to connect to the MySQL server from the IP-10.10.50.127 host and use 654321 as the password
|
mysql>GRANTALL PRIVILEGES ON *.* TO ‘jack‘@’10.10.50.127’ IDENTIFIED BY ‘654321‘ WITH GRANTOPTION;mysql>FLUSH RIVILEGES |
C: Run on the machine where MySQL is installed:
| 12345678 |
//into MySQL server d:\mysql\bin\>mysql-h localhost-u root //give any host access to data Code class= "SQL Plain" >MYSQL> grant all privileges on *.*  to ' root ' @ '% ' with grant option //make the modification effective MYSQL>FLUSH  privileges //exiting the MySQL server mysql>exit |
MySQL initializes the root password and allows remote access