mysql5.7设置密码
update user set authentication_string=password('你的密码') where user='root' and host='%'
上面的user='root' and host='%'可以自行设置,一般user都是root,host可以选择localhost;%表示可以远程访问host
mysql8设置密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'