mysqladmin -u root -p旧密码 password 新密码;
[[email protected] ~]$ mysqladmin -u root -p123456 password admin
1.新建用户设置密码 create user [email protected]'localhost' identified by '密码'; 2.已有用户修改密码 alter user [email protected]'localhost' identified by '密码';
set password = password ('新密码');
set password for '用户名'@'localhost或者%' =password('密码');
update MySQL.user set authentication_string=password('密码') where user='root'; flush privileges‘;
在/etc/my.cnf 中的[mysqld]中添加skip-grant-tables
输入mysql就可以直接进入数据库