Mysql 基本的命令
本文最后更新于 1047 天前,其中的信息可能已经有所发展或是发生改变。

修改Mysql密码

mysqladmin -u用户名 -p旧密码 password 新密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';
flush privileges;
mysql -u root -p

use mysql;
update user set password=password("newPassword") where user='root';
flush privileges;
quit;

常见错误

  • client does not support authentication protocol requested by server
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Awer133//';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
出现连接失败的原因:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password

把用户密码登录的加密规则还原成mysql_native_password这种加密方式

开放root远程访问权限

use mysql;
update user set host='%' where user='root';
select user,host from user where user = 'root';

创建用户 并且赋权

create user 'newuser'@'%' identified by 'password';
flush privileges;
grant all privileges on [databasename].* to 'newuser'@'%' with grant option;
show grants for 'newuser'@'%';
ALTER USER 'newuser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
对此文章 《Mysql 基本的命令》 如有异议、侵犯您的版权,及时联系我处理或者在本站留言。谢谢!
暂无评论

发送评论 编辑评论


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