要设置密码的特殊字符,请使用以下语法 -create user 'yourUserName'@'yourHostName' identified by 'yourSpecialCharacterPas
要设置密码的特殊字符,请使用以下语法 -
create user 'yourUserName'@'yourHostName' identified by 'yourSpecialCharacterPassWord';
让我们实现上述语法来创建一个新用户并使用特殊字符设置密码 -
Mysql> create user 'Mike'@'localhost' identified by 'Mike_123456';
Query OK, 0 rows affected (0.35 sec)
让我们检查存储 mysql 用户和主机的表 -
mysql> select user,host from MySQL.user;
这将产生以下输出。新用户创建成功 -
+------------------+-----------+
| user | host |
+------------------+-----------+
| Bob | % |
| Charlie | % |
| Robert | % |
| User2 | % |
| mysql.infoschema | % |
| mysql.session | % |
| mysql.sys | % |
| root | % |
| @UserName@ | localhost |
| Adam Smith | localhost |
| Chris | localhost |
| David | localhost |
| James | localhost |
| John | localhost |
| John Doe | localhost |
| Mike | localhost |
| User1 | localhost |
| am | localhost |
| hbstudent | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
+------------------+-----------+
21 rows in set (0.00 sec)
--结束END--
本文标题: 创建新的 MySQL 用户时为密码设置特殊字符?
本文链接: https://lsjlt.com/news/437757.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0