咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

如何在centos6.5系统修改MySQL默认用户root的密码

2016-06-24 15:39:48 12699次

1.用默认账号密码登录MySQL服务端

[root@domin ~]# mysql -u root -p

2.切换到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.执行更改密码的语句

mysql> update user set password=password('landui') where user='root';

Query OK, 3 rows affected (0.01 sec)

Rows matched: 3  Changed: 3  Warnings: 0

4.刷新权限表

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

5.现在退出就可以用新密码登录啦~

mysql> exit;

Bye


首页
最新活动
个人中心