刚装个Ubuntu虚拟机,懒得下包就用apt直接装了个MySQL,默认安装了5.7版本的,安装也没提示说设置密码,登陆也就在root用户下就能直接登陆了。
想着给设置个密码吧,就进user表修改,修改了半天提示我password不存在这一列
desc表结构一看,找不到[password]这一列了,只有[authentication_string],在MySQL5.7中[user]表中[password]已经修改为[authentication_string]了
修改方式就成了
update user set authentication_string="设置的密码" where user="root";