1. Download MySQL Community Server 5.7.16 and install it
2. Go to the bin directory of the mysql installation directory, enter cmd in the file address bar and press Enter
3. Enter the command: mysqld --initialize-insecure --console
4. Enter the command: mysqld -install
5.mysql -u root
--skip-password
6.
ALTER
USER
'root'
@
'localhost'
IDENTIFIED
BY
'123456'
;
\quit 7.
8.mysql -h localhost -uroot -p
The installation is complete
Authorize remote login
Login with administrator account
Execute the command: grant all PRIVILEGES on *.* to zhanghao@'%' identified by '123456';
Refresh takes effect: flush privileges;
Command Explanation:
all PRIVILEGES means granting all privileges to the specified user, here can also be replaced by granting a specific privilege, such as: select, insert, update, delete, create, drop, etc. The specific privileges are separated by "," commas.
*.* Indicates which table the above permissions are for, the first * refers to the database, the latter * indicates that for all tables, all tables in a database are authorized as "database name.*", for a certain A certain table of a database is authorized as "database name.table name".
zhanghao indicates which user you want to authorize. This user can be an existing user or a non-existing user.