update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
关闭正在运行的 MySQL :
?
1
[[email protected] ~]# service mysql stop
运行
?
1
[[email protected] ~]# mysqld_safe --skip-grant-tables &
为了安全可以这样禁止远程连接:
?
1
[[email protected] ~]# mysqld_safe --skip-grant-tables --skip-networking &
使用mysql连接server:
?
1
[[email protected] ~]# mysql -p
更改密码:
?
1
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
关闭正在运行的 MySQL :
?
1
[[email protected] ~]# service mysql stop
运行
?
1
[[email protected] ~]# mysqld_safe --skip-grant-tables &
为了安全可以这样禁止远程连接:
?
1
[[email protected] ~]# mysqld_safe --skip-grant-tables --skip-networking &
使用mysql连接server:
?
1
[[email protected] ~]# mysql -p
更改密码:
?
1
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';