MySQL Connection Failure

Discussion in 'BungeeCord Plugin Help' started by fordboy26, Nov 9, 2016.

  1. Hello spigot, I have an US Proxy and an EU Proxy. I'm using the SyncBungeeCount plugin to sync both my player counts but on the EU proxy when i start it and it tries to connect to the US's MySQL server but says this:

    Code (Text):
    [SyncBungeeCount] MySQL connection failure!
    I know this is something to do with my MySQL server not being able to allow outside connections but need help on how to let the US MySQL server allow the EU Sync Plugin to connect to it.

    Sincerely, fordboy.
     
  2. Try this on your mysql server (how you said it's the US):
    service mysql stop
    nano /etc/mysql/my.cnf
    *Scroll down a bit and search for 'bind_address' and change its value to the servers ip in the local network
    *through this the server is open to the public
    service mysql start
     
  3. When I go to stop the MySQL server with the command "service mysql stop" it says "
    mysql: unrecognized service" and when I enter that file nothing is in it.
     
  4. Then it's not your mysql server
     
  5. I use the command service mysqld stop and start and it works but i dont see the "bind-address=" part
     
  6. Is something in the config?
    If not look at this locations:
    /etc/my.cnf
    /etc/mysql/my.cnf
    $MYSQL_HOME/my.cnf
    [datadir]/my.cnf
    ~/.my.cnf
     
  7. What?
    What?
     
  8. You said you didn't found this key. Is something else in the config or is it empty? If it's empty look in one of the locations said above.
     
  9. This is what the file looks like:

    Code (Text):
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
     
     
  10. Did you try to "scroll" around in the file with the arrow keys? And if there's nothing else look at the other paths above and search for "bind-address".
     
  11. Erm....

    Code (Text):
    Error:    Directory /etc/mysql: no such file or directory
    Error:    Failed to retrieve directory listing
     
  12. :rolleyes: try reinstalling mysql
     
  13. MySQL works fine, I have my forums setup with it and it works fine. It's MySQLD when i do the command service mysqld stop/start
     
  14. Oh ok, but normally there should be one of the configs and the key I said.
     
  15. There is a my.cnf in the folder /etc/ is that it?
     
  16. Yes, I think so.
     
  17. I looked in there but i dont see anything to do with the bind IP
     
  18. electronicboy

    IRC Staff

    The full error from the report would be highly beneficial.
    There are a few steps to actually being able to connect to a MySQL database remotely;

    1. you're looking for a value called bind-address, if you can't it, cd to /etc/mysql and `grep -R bind-address *` that should help find where the exact config is that you're looking for. different distros shove this in different files in there, on ubuntu it's currently `/etc/mysql/mysql.conf.d/mysqld.cnf`

    2. MySQL identifies users based on their user and hostname, if you want to access a MySQL server remotely, you need to create another MySQL user, with host set to the IP address that the server will connect to (If you have multiple IP addresses,you'll have to confirm which on this is, you can also use a % in the field to match all IP addresses, however that is not recommended), and then give the new user privilages on the database you want it to access (after all, it is a completely separate account)

    After that, it should work, providing that you have nothing setup to block that port (e.g. iptables)
     
    • Agree Agree x 1
  19. Hello, I have tried looking in that file and all I see is:

    Code (Text):

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
     
    I'm also using Centos 6.
     
  20. electronicboy

    IRC Staff

    then try looking for that entry with grep, like I said how to do. Otherwise, add the setting manually