Ghost32 - 安全的系统软件下载站!

ghost32怎么安装系统|装机必备|最新专题|最近更新

当前位置:首页 > 系统文章 > 网络技术

Centos系统下如何修改Mysql数据库的root账号密码

时间:2018-12-01 14:55:00 来源: 点击:
手机扫码继续观看
Centos系统下如何修改Mysql数据库的root账号密码

1、用帐号登录mysql

mysql –u root -p

或#mysql –u root

2、改变用户数据库

命令:mysql>use mysql

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

3、修改密码

     密码要用password()函数进行加密!!!!蓝色字体是新密码

命令:mysql> update user set password=password('root') where user='root';

mysql> update user set password=password('root') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

4、刷新权限表

命令:mysql> flush privileges;

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

5、退出mysql并对mysql进行重启即可!!

service mysqld restart

 

上一篇:详细的IPv6获取教程,开启64位短码地址

下一篇:避开网络限制,通过蓝牙共享网络连接

网友评论(共有 0 条评论)

请自觉遵守互联网相关政策法规,评论内容只代表网友观点,与本站立场无关!

最新评论