CentOS下如何修改MySQL的root密码
CentOS下如何修改MySQL的root密码
1、用帐号登录mysql
mysql –u root
或#mysql –uroot –p
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
相关推荐
lpfvip00 2020-10-07
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11