Mysql的root密碼由空改為123456,root123456

來源:互聯網
上載者:User

Mysql的root密碼由空改為123456,root123456

使用mysqladminmysqladmin -u root -p password mypasswd輸入這個命令後,需要輸入root的原密碼(空的),然後root的密碼將改為mypasswd。

[work@master bin]$ mysqladmin -u root password 123456

[work@master bin]$ 

以上命令執行完後,第二行為空白,這說明你的密碼已經更新成功了。

root密碼為123456了。


對於mysql怎更改root密碼

第一步:登陸MYSQL
mysql -u root -p
然後斷行符號,進入(等於用空密碼進入)
第二步:
use mysql;
update user set password=password('新密碼') where user='root';
這步就更新了密碼
第三步:
flush privileges;
重新整理許可權.

OK了,改好了
 
linux下密碼問題: ,我已經改了root的密碼123456,可重新登入輸入123456還報錯MYSQL的密碼問題:

1、update修改password應該是hash值的
MySQL>update user set password=password(‘123456’) where user=’root’;

2、set修改mysql的Hash密碼
MySQL>SET PASSWORD FOR ‘root′@’localhost’ = PASSWORD('123456’);

3、用mysqladmin命令修改密碼
Shell> mysqladmin -uroot -poldpassword password 123456;

4、用grant修改或create user時設定密碼
MySQL>grant all privileges on db01.* to user01@”localhost” Identified by “newpassword”;
MySQL>CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpass';
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.