简体   繁体   中英

Unable to connect to MySQL from Ejabberd installed in Ubuntu machine. AWS - EC2

I have installed Ejabberd in Ubuntu machine (An Amazon EC2 machine). I have another machine which is a windows server and I am running MySQL in it. The service is up and running.

But for some reasons when I start Ejabberd, I am not able to connect to MySQL db which is at the windows machine. I made sure the ports are opened (3306 from the MYSQL machine).

Also, all the neccesary beam files are configured in Ejabberd Ubuntu machine. Not sure why I am not able to connect to MySQL. The error which I get in the log is below. Any help would be great. I have configured the security group in Windows machine to accept request to port 3306 also. Still not able to connect. Thanks for your help

=ERROR REPORT==== 2014-04-21 00:38:16 ===
E(<0.1005.0>:ejabberd_odbc:542) : mysql_conn: Failed connecting to "172.31.15.211":3306        : {error,
                                                                                           "timeout"}

=ERROR REPORT==== 2014-04-21 00:38:16 ===
E(<0.292.0>:ejabberd_odbc:542) : mysql_conn: post_start timeout


=INFO REPORT==== 2014-04-21 00:38:16 ===
I(<0.292.0>:ejabberd_odbc:216) : mysql connection failed:
** Reason: "timed out"
** Retry after: 30 seconds

=WARNING REPORT==== 2014-04-21 00:38:16 ===
W(<0.292.0>:ejabberd_odbc:281) : unexpected info in connecting: {mysql_conn,
                                                             <0.1014.0>,
                                                             {error,
                                                              connect_failed}}

I think you should check your mysql configuration file my.ini file in windows case

  • locate you my.cnf or in windows case my.ini file that should locate these setting in my.ini , comment out the #skip-networking and in your case bind your IP address

    bind-address = 0.0.0.0 (Your IP)

Second thing your should give the permission of that user to connect the in mysql

GRANT ALL ON DatabaeName.* TO DBUser@'%' IDENTIFIED BY 'PASSWORD';
flush privileges;

Restart your mysql , let me know how it goes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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