MySQL 5.7 ERROR 1045 (28000) Access denied

The reason is MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7. It doesn’t use empty root password for mysql as previous version does, how to revert to old fashion?

Check what’s random password it generated when installing

# sudo grep 'temporary password' /var/log/mysqld.log

Login to mysql server as root

# mysql -u root -p

Change mysql root user’s password for the first time

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '{new password}';
Pls replace {new password} with below rules, e,g: ‘Goodpwd@1’
– at least 8 characters
– at least contains one Uppercase character
– at least contains one digit
– at least contains one special character

Run following sql command to remove validate_password plugin

mysql> uninstall plugin validate_password;

Set root password to the empty one

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇