***Linux(Ubuntu、CentOS)下开放 MySQL 服务远程访问

Navicat没法远程链接阿里云的解决方法:

是由于在阿里云端有IP限制,因此容易致使没法远程的错误mysql



CentOS 直接跳到第二步。

第一步,修改配置文件:

Ubuntu(CentOS 直接跳到第二步):c++

vim /etc/mysql/my.cnf

找到:sql

bind-address = 127.0.0.1

改成:数据库

bind-address = 0.0.0.0 #容许任意ip地址访问

也能够指定IP地址。

而后重启MySQL:vim

sudo /etc/init.d/mysqld restart


第二步,修改数据库配置:

受权root用户进行远程链接,注意替换 “password” 为 root 用户真正的密码:ide

grant all privileges on *.* to root@"%" identified by "password" with grant option; flush privileges;

第二行命令使设置生效,能够立刻链接。阿里云

相关文章
相关标签/搜索