密码HASH会保存在mysq.user表里面,我们可以从这个表里面得到密码HASH:
mysql -uroot -p -Dmysql -e “select user,password,host from user”
2、 mysqladmin 修改
Shell>mysqladmin -uroot -poldpassword password newpassword
3、create user或grant时修改
MySQL>create database db01
MySQL>CREATE USER ‘user01’@’localhost’ IDENTIFIED BY ‘Welcome'
MySQL>grant all privileges on db01.* to user01@”localhost” Identified by “Welcome”
4、update user表修改
mysql -uroot -p -Dmysql -e “update user set password=password(‘新密码’) where user=’root'”
5、用set命令
mysql -uroot -p -Dmysql -e “SET PASSWORD FOR ‘user01’@’localhost’ = PASSWORD(‘Welcome’)”
mysql设置数据库密码常用的有四种方法:1.用root
登陆mysql终端
mysql>set
password
=password(‘raykaeso‘)
mysql>flush
privileges
2.在mysql终端中使用grant语句
mysql>grant
all
on
*.*
to
‘root’@’localhost’
identified
by
‘raykaeso’with
grant
option
mysql>flush
privileges
3.在mysql库user表中直接修改
mysql>use
mysql
mysql>update
user
set
password=password(‘raykaeso’)
where
user=’root'
mysql>flush
privileges
4、在shell命令行里修改mysql用户密码
[root@raykaeso leixuesong]
mysqladmin
-u
root
password
“your
password”
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)