简体   繁体   English

使用Sqldbx远程连接到EC2 MySql

[英]Connect remotely to EC2 MySql with Sqldbx

I have sqldbx installed on my windows 10 64bit. 我在Windows 10 64bit上安装了sqldbx。 When I choose "new connection" I have DBMS type "MySQL" to choose. 当我选择“新连接”时,可以选择DBMS类型“ MySQL”。 At first I got errors for missing Dlls but I overcame it. 起初,我因缺少Dll而出错,但我克服了它。

My sqldbx is installed on Ubuntu in AWS EC2 instance. 我的sqldbx已安装在AWS EC2实例的Ubuntu上。 It has a db and it's working well with my site and using phpmyadmin. 它有一个数据库,并且与我的网站以及使用phpmyadmin都运行良好。 I guess my MySql is not configured for remote connections. 我猜我的MySql没有配置为远程连接。 I tried to add a line in mysql configuration to bind to the external ip but not only it didn't work remotely, it also broke the internal connection and site didn't work well. 我试图在mysql配置中添加一条线来绑定到外部ip,但不仅不能远程运行,而且还破坏了内部连接,并且站点无法正常运行。

Anyone can help please? 有人可以帮忙吗? Thanks! 谢谢!

It appears that the configuration file is NOT named my.cnf and that's why mine didn't have the bind data. 似乎配置文件未命名为my.cnf,这就是为什么我的没有绑定数据的原因。

The RIGHT file is here: /etc/mysql/mysql.conf.d/mysqld.cnf 正确的文件在这里:/etc/mysql/mysql.conf.d/mysqld.cnf

Once I comment out the bind line (and I know it's security issue, it's temp) I was able to connect remotely using the external IP and default port 3306. In order to connect with root you need to run this first: mysqladmin -u root -p pass 一旦注释掉绑定线(并且我知道这是安全问题,这是暂时的),我便可以使用外部IP和默认端口3306进行远程连接。要与root用户连接,您需要先运行此命令:mysqladmin -u root -p传递

GRANT ALL PRIVILEGES ON . 授予所有特权 TO 'root'@'%' IDENTIFIED BY 'PASSWORD' with grant option; 带有授权选项的“密码”标识为“ root” @“%”;

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM