Navicat for mysql 远程连接 mySql数据库1045错误问题
2014-09-12 10:40
771 查看
如果没有给远程登录用户添加所有机器都能访问的权限,将会出现“1045-Access denied for user root@IT(using password:NO)”,这表明需要添加权限; 添加命令如下: 1)grant all on *.* to 用户名@"%" identified by "密码"; 2)flush privileges;
完成以上步骤,就可以远程访问MySQL数据库了。grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;
权限1,权限2,…权限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限。
当权限1,权限2,…权限n被all privileges或者all代替,表示赋予用户全部权限。
当数据库名称.表名称被*.*代替,表示赋予用户操作服务器上所有数据库所有表的权限。
用户地址可以是localhost,也可以是ip地址、机器名字、域名。也可以用’%'表示从任何地址连接。
‘连接口令’不能为空,否则创建失败。
例如:
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。mysql添加用户方法建立数据库gamespcreate database gamesp;添加用户grant all on 数据库名.* to 用户名@localhost identified by '密码';
grant all on gamesp.* to newuser@localhost identified by 'password';
添加一个远程用户,名为username密码为password
GRANT ALL PRIVILEGES ON *.* TO [b]username@"%" IDENTIFIED BY 'password'[/b]说明:(1)grant all 赋予所有的权限(2)gamesp.* 数据库 gamesp 中所有的表(3)newuser 用户名(4)@localhost 在本地电脑上的 mysql server 服务器(5)identfified by 'password' 设置密码
删除用户
use mysql
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;
修改密码
mysqladmin -uroot -plk317921web password "111111"
完成以上步骤,就可以远程访问MySQL数据库了。grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;
权限1,权限2,…权限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限。
当权限1,权限2,…权限n被all privileges或者all代替,表示赋予用户全部权限。
当数据库名称.表名称被*.*代替,表示赋予用户操作服务器上所有数据库所有表的权限。
用户地址可以是localhost,也可以是ip地址、机器名字、域名。也可以用’%'表示从任何地址连接。
‘连接口令’不能为空,否则创建失败。
例如:
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。mysql添加用户方法建立数据库gamespcreate database gamesp;添加用户grant all on 数据库名.* to 用户名@localhost identified by '密码';
grant all on gamesp.* to newuser@localhost identified by 'password';
添加一个远程用户,名为username密码为password
GRANT ALL PRIVILEGES ON *.* TO [b]username@"%" IDENTIFIED BY 'password'[/b]说明:(1)grant all 赋予所有的权限(2)gamesp.* 数据库 gamesp 中所有的表(3)newuser 用户名(4)@localhost 在本地电脑上的 mysql server 服务器(5)identfified by 'password' 设置密码
删除用户
use mysql
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;
修改密码
mysqladmin -uroot -plk317921web password "111111"
相关文章推荐
- Navicat for mysql 远程连接 mySql数据库10061、1045错误问题
- Navicat for mysql 远程连接 mySql数据库10061、1045错误问题
- Navicat for mysql 远程连接 mySql数据库10061、1045错误问题 (转)
- Navicat for mysql 远程连接 mySql数据库10061、1045错误问题
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接 mySql数据库10061、1045错误
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- navicat for mysql 远程连接 mySql数据库会提示10061、1045错误
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接 mySql数据库10061、1045错误
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- 在windows下使用Navicat for mysql 远程连接linux系统下的 mySql数据库会提示10061、1045错误
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接 mySql数据库10061错误问题
- Navicat for mysql 远程连接mysql数据库问题 1130报错
- 解决Navicat for MySQL打开连接时出现错误提示1045 access denied for user 'root'@'localhost' (using password yes)的问题
- Navicat for mysql远程连接数据库详解(1130错误解决方法)