阿里云下 centos7 xampp 数据库navicat远程连接

1:赋予 opt/lampp /mysql跟etc 文件夹 777 权限

重启 xampp ,如果下面显示的话就成功了



如果没有:

进入opt/lampp/bin

命令 ./mysql -uroot -p

输入数据库密码

进入数据库

输入命令

MariaDB [(none)]>  show global variables like 'port';

显示这种命令是失败的,因为默认端口应该是3306,而下面是0


修改etc目录跟 mysql数据库目录的权限

重启服务器

他就会报wearning 警告


XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignored
ok.

[root@izwz9fdnemzvxc2cc3yofgz lampp]# Warning: World-writable config file '/opt/lampp/etc/my.cnf' is ignore



不理它的警告

进入数据库操作上面的命令

就会出现


然后就大功告成,




navicat能远程连接数据库了 


注意,阿里云要注意防火墙的3306端口是否开启, 跟控制台的安全防火墙tcp mysql 3306端口规则


telnet ip 3306

监听端口 netstat -ano | grep 3306



猜你喜欢

转载自blog.csdn.net/heyuqing32/article/details/80961635