MySQL 5.5用户迁移到5.7用户


MySQL 5.5和5.7的mysql.user表有差异:

5.5 5.7
Host Host
User User
Password
Select_priv Select_priv
Insert_priv Insert_priv
Update_priv Update_priv
Delete_priv Delete_priv
Create_priv Create_priv
Drop_priv Drop_priv
Reload_priv Reload_priv
Shutdown_priv Shutdown_priv
Process_priv Process_priv
File_priv File_priv
Grant_priv Grant_priv
References_priv References_priv
Index_priv Index_priv
Alter_priv Alter_priv
Show_db_priv Show_db_priv
Super_priv Super_priv
Create_tmp_table_priv Create_tmp_table_priv
Lock_tables_priv Lock_tables_priv
Execute_priv Execute_priv
Repl_slave_priv Repl_slave_priv
Repl_client_priv Repl_client_priv
Create_view_priv Create_view_priv
Show_view_priv Show_view_priv
Create_routine_priv Create_routine_priv
Alter_routine_priv Alter_routine_priv
Create_user_priv Create_user_priv
Event_priv Event_priv
Trigger_priv Trigger_priv
Create_tablespace_priv Create_tablespace_priv
ssl_type ssl_type
ssl_cipher ssl_cipher
x509_issuer x509_issuer
x509_subject x509_subject
max_questions max_questions
max_updates max_updates
max_connections max_connections
max_user_connections max_user_connections
plugin plugin
authentication_string authentication_string
password_expired
password_last_changed
password_lifetime
account_locked


所以,mysql 5.5的Password的数据应该迁移到mysql 5.7的 authentication_string字段,如下:

INSERT INTO mysql.`user`(Host,User,authentication_string,Select_priv	,Insert_priv	,Update_priv	,Delete_priv	,Create_priv	,Drop_priv	,Reload_priv	,Shutdown_priv	,Process_priv	,File_priv	,Grant_priv	,References_priv	,Index_priv	,Alter_priv	,Show_db_priv	,Super_priv	,Create_tmp_table_priv	,Lock_tables_priv	,Execute_priv	,Repl_slave_priv	,Repl_client_priv	,Create_view_priv	,Show_view_priv	,Create_routine_priv	,Alter_routine_priv	,Create_user_priv	,Event_priv	,Trigger_priv	,Create_tablespace_priv	,ssl_type	,ssl_cipher	,x509_issuer	,x509_subject	,max_questions	,max_updates	,max_connections	,max_user_connections	,plugin) VALUES ('%', 'lhr', '*827F67F8037D3F8F076544B6FFC6D56058166D8B', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0, 0, 'mysql_native_password');
flush PRIVILEGES;











About Me

........................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在itpub、博客园、CSDN和个人微 信公众号( DB宝)上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文博客园地址: http://www.cnblogs.com/lhrbest

● 本文CSDN地址: https://blog.csdn.net/lihuarongaini

● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群号: 230161599 、618766405

● 微 信群:可加我微 信,我拉大家进群,非诚勿扰

● 联系我请加QQ好友 646634621 ,注明添加缘由

● 于 2020-04-01 06:00 ~ 2020-04-30 24:00 在西安完成

● 最新修改时间:2020-04-01 06:00 ~ 2020-04-30 24:00

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

........................................................................................................................

小麦苗的微店https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麦苗出版的数据库类丛书http://blog.itpub.net/26736162/viewspace-2142121/

小麦苗OCP、OCM、高可用网络班http://blog.itpub.net/26736162/viewspace-2148098/

小麦苗腾讯课堂主页https://lhr.ke.qq.com/

........................................................................................................................

使用 微 信客户端扫描下面的二维码来关注小麦苗的微 信公众号( DB宝)及QQ群(DBA宝典)、添加小麦苗微 信, 学习最实用的数据库技术。

........................................................................................................................

欢迎与我联系

 

 



请使用浏览器的分享功能分享到微信等