如何设置mysql的登录密码?

2023年 4月 17日 47.2k 0

设置方法:1、使用“set password =password(你的密码);”命令;2、使用“update user set password=password(你的密码) where user=root;”命令。 mysql设置密码 有很多方法: 1、用root进入mysql后 mysqlset p

设置方法:1、使用“set password =password('你的密码');”命令;2、使用“update user set password=password('你的密码') where user='root';”命令。

mysql设置密码

有很多方法:

1、用root进入mysql后

mysql>set password =password('你的密码');
mysql>flush privileges;

2、使用GRANT语句

mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ;
mysql>flush privileges;

3、进入mysql库修改user表

mysql>use mysql;
mysql>update user set password=password('你的密码') where user='root';
mysql>flush privileges;

推荐教程:mysql视频教程

以上就是如何设置mysql的登录密码?的详细内容,更多请关注每日运维其它相关文章!

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论