mysql密码修改
2023/3/17 13:34:03
浏览
次
mysql密码修改update mysql.user set authentication_string=password(asdf@uiop.888) where user=root and host=%;update mysql.user set authentication_string=password(asdf@uiop.888) where user=root;flush privileges; mysql数据库指定ip远程访问,指定用户,指定…
update mysql.user set authentication_string=password('asdf@uiop.888') where user='root' and host='%';
update mysql.user set authentication_string=password('asdf@uiop.888') where user='root';
flush privileges;
mysql数据库指定ip远程访问,指定用户,指定数据库
1.登录 mysql -u root -p
输入密码进行登录
2.权限设置及说明
①添加远程ip访问权限
GRANT ALL PRIVILEGES ON "." TO 'root'@'192.168.199.99' IDENTIFIED BY 'asdf@uiop.888' WITH GRANT OPTION;
②命令解释
第一行中 .99 是阿里云内网的一个地址,这个是允许远程访问的 IP 的值
root 是账户名
asdf@uiop.888是密码
即允许来自 192.168.199.99的连接并使用root账户和asdf@uiop.888
这个密码进行访问。ALL PRIVILEGES ON 后面的 *.* 表示所有数据库,即完全访问权限,可以指定为特定数据库。而IP这里,可以使用 % 来表示所有IP
第二行是使设置立即生效
来源:问问计算机(微信:wenwenjisuanji,邮箱:changyandou@126.com),欢迎分享!