数据库建库授权

CREATE DATABASE wisdom_supplies; 建库

grant select,insert,update,delete on wisdom_supplies.* to back@'172.16.%' identified by 'Aizhixin@2021'; 数据库授权

flush privileges; 刷新生效 `

wisdom_supplies 代表库名

backw 代表用户

Aizhixin@2021 密码


Type `help' to learn how to use Xshell prompt.
[C:\~]$

Connecting to 172.16.100.40:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Thu Feb 2 10:11:08 2023 from 172.16.100.174
[root@general-mw-001 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 915923
Server version: 5.7.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create user dblsh identified by 'dbls@2023';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> create user dblshui identified by 'dblshui123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements   这种报错意思是密码不符合要求
mysql> exit
Bye
[root@general-mw-001 ~]# mysql -umysql -p
Enter password:
ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES)
[root@general-mw-001 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 915973
Server version: 5.7.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create user ywliyq identified by '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> create user dblshui identified by 'Dblshui@123';
Query OK, 0 rows affected (0.09 sec)

mysql> grant select,insert,update on dbl_tast_db_shui.* to dblshui@'172.16.%' identified by 'Dblshui@123';
Query OK, 0 rows affected, 1 warning (0.03 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)

 

 

posted @ 2022-12-14 12:42  攻城狮联盟  阅读(28)  评论(0)    收藏  举报