- 阿里云
为阿里云里面设置安全组,添加端口3306作为sql的使用端口
- MySQL
在阿里云(Ubuntu18)上部署MySQL
使用如下命令进行MySQL的安装
apt-get update apt-get install mysql-server apt-get install mysql-client apt-get install libmysqlclient-dev
使用如下的命令查看安装是否成功并重启MySQL
sudo netstat -tap | grep mysql /etc/init.d/mysql restart
开启远程连接
将host设置为%表示任何ip都能连接mysql,当然您也可以将host指定为某个ip
update user set host='%' where user='root' and host='localhost'; flush privileges;
赋予root用户权限
grant all on *.* to root@'%' identified by '密码' with grant option;
flush privileges;
修改密码
update mysql.user set authentication_string=PASSWORD('你的密码'), plugin='mysql_native_password' where user='root';
重启MySQL
service mysql restart
- Navicat
常规设置
使用本地主机名,3306端口(MySQL的专用端口)
MySQL的用户和密码
此处是
SSH设置
使用阿里云的公网ip,对应的SSH连接端口为22(阿里云服务器系统端口)
使用阿里云的用户名和密码