mysql设置远程账号

来源:互联网 发布:淘宝网靠枕 编辑:程序博客网 时间:2024/04/30 17:12
1、设置数据库root密码
通过登录mysql系统,
mysql -uroot -p
Enter password: 【输入原来的密码】
mysql>use mysql;
mysql> update user set password=password('rootpassword') where user='root';
mysql> flush privileges;
mysql> exit;

2、设置数据库远程连接账号
通过登录mysql系统,
mysql -uroot -p
Enter password: 【输入原来的密码】
mysql>grant all privileges on *.* to 'cabinremotedb'@'%' identified by "iEL8HVXZuKUCbRZOwveF" with grant option;
(

grant all privileges on *.* to 创建的用户名 @"%" identified by "密码";

)
mysql>
flush privileges;

注:例子中的cabinremotedb是用户名,iEL8HVXZuKUCbRZOwveF是密码,根据实际使用替换。

0 0
原创粉丝点击