mysql> create database test; Query OK, 1 row affected (0.00 sec) mysql> mysql> create user 'chenyj'@'*' identified by 'chenyj'; Query OK, 0 rows affected (0.01 sec) mysql> mysql> grant all on test.* to chenyj@'*'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> mysql> grant all on test.* to 'chenyj'@'*'; Query OK, 0 rows affected (0.01 sec) mysql> grant connect to 'chenyj'@'*'; ERROR 3523 (HY000): Unknown authorization ID `connect`@`%` mysql> mysql> create user 'chenyj'@'%' identified by 'chenyj'; Query OK, 0 rows affected (0.01 sec) mysql> mysql> grant all on test.* to 'chenyj'@'%'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 测试: [root@mysql8-01 ~]# mysql -h localhost -u chenyj -p Enter password: ERROR 1045 (28000): Access denied for user 'chenyj'@'localhost' (using password: YES) [root@mysql8-01 ~]# [root@mysql8-01 ~]# mysql -h localhost -u chenyj -p Enter password: ERROR 1045 (28000): Access denied for user 'chenyj'@'localhost' (using password: YES) [root@mysql8-01 ~]# mysql -h localhost -u chenyj -p Enter password: ERROR 1045 (28000): Access denied for user 'chenyj'@'localhost' (using password: YES) [root@mysql8-01 ~]# [root@mysql8-01 ~]# mysql -h localhost -u chenyj -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.14 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> mysql> 需要注意的是通配符应该采用'%'
mysql用户创建
来源:这里教程网
时间:2026-03-01 12:04:01
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- 3ds max制作立体效果的角斗士之王
3ds max制作立体效果的角斗士之王
26-03-01 - mysql用户创建
mysql用户创建
26-03-01 - 怎样通过以太网远程访问PLC 较简单的方法
怎样通过以太网远程访问PLC 较简单的方法
26-03-01 - mysql审核平台yearning及inception安装
mysql审核平台yearning及inception安装
26-03-01 - MySQL高可用方案MHA在线切换的步骤及原理
MySQL高可用方案MHA在线切换的步骤及原理
26-03-01 - 一条SQL语句在MySQL中如何执行的
一条SQL语句在MySQL中如何执行的
26-03-01 - SOAR的启发式规则建议
SOAR的启发式规则建议
26-03-01 - 数据库MySQL创建表定义主键 (新手必看)
数据库MySQL创建表定义主键 (新手必看)
26-03-01 - MySQL漏洞更新求助
MySQL漏洞更新求助
26-03-01 - 3dmax和zbrush制作瘦老头打鸟行动
3dmax和zbrush制作瘦老头打鸟行动
26-03-01
