MySQL怎样授权用户远程访问数据库

admin 提交于 星期五, 03/13/2015 - 17:24

1. 运行SQL语句授权用户

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'

2. 编辑/etc/mysql/my.cnf,把bind-address = 127.0.0.1注释掉

3. 重启MySQL服务

service mysql restart

 

如果用户还需要拥有授权其他用户的权限,则需要用下面的命令,用户要退出重新登录mysql才能生效:

标签

怎样实现SSH免密码登录

admin 提交于 星期一, 03/09/2015 - 11:10

生成秘钥对(如果已经有就不用再生成了):
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
 

标签