How to install green version of MySQL Community Server 5.7. 16 and implement remote login

  • 2021-08-28 21:23:37
  • OfStack

1. Download MySQL Community Server 5.7. 16 and install it

2. Go into the bin directory of the mysql installation directory and enter cmd in the file address bar

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'IDENTIFIEDBY '123456';

7.\quit

8. mysql -h localhost -uroot -p

Installation complete

Authorize remote login

Log in as an administrator account

Execute a command: grant all PRIVILEGES on *.* to zhanghao@'%' identified by '123456';

Refresh effective: flush privileges;

Command interpretation:

all PRIVILEGES means giving all permissions to a specified user, which can also be replaced by giving specific permissions to a certain 1, for example:

select,insert,update,delete,create,drop And so on, the specific permissions are separated by "," half commas.

*.* indicates which table the above permissions are for, the first * refers to the database, and the following * indicates that for all tables, all tables of a 1 database are authorized as "database name. *", and a 1 table of a 1 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.

Summarize


Related articles: