MYSQL centos error

Discussion in 'Systems Administration' started by kaketoe, Jul 2, 2016.

  1. Hey,

    I just bought a shared hosting server at a hosting company and i want to run my mysql server on my own server at home.

    But i can't seem to get the plugins on that server to connect to my mysql server.

    i've got my phpmyadmin server working and imported my mysql databases

    the mcmmo plugin is throwing the most obvious errors
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    [17:55:28] [Craft Scheduler Thread - 13/ERROR]: [mcMMO] SQLState: 08S01
    [17:55:28] [Craft Scheduler Thread - 13/ERROR]: [mcMMO] VendorError: 0
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] Location: sun.reflect.GeneratedConstructorAccessor123 newInstance -1
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] SQLException: Communications link failure

    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] SQLState: 08S01
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] VendorError: 0
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] Location: sun.reflect.GeneratedConstructorAccessor123 newInstance -1
    [17:55:43] [Craft Scheduler Thread - 28/ERROR]: [mcMMO] SQLException: Communications link failure

    It is prob a problem on my end.
    i've portforwared and made sure everything was running.
    How can i fix this?
     
  2. FormallyMyles

    Supporter

    Ensure you're using localhost or the correct IP to the MySQL.

    Consider contacting your host for help with the details otherwise.
     
  3. Test you have a mySQL instance provisioned:

    Using the password your vendor provided you:
    Code (Text):

    # mysql -u root -D mysql -p
     
    then enter the password

    Logged in to mySQL?

    If not check the password with the vendor of your server.

    If you can login to the mySQL service, create a database:

    Code (Text):

    > create database FooServer;
    > create user 'Joe'@'localhost' identified by 'SomePassword';
    > grant all on FooServer.* to 'Joe'@'localhost';
     
    then exit mysql:

    Re-enter:
    Code (Text):

    mysql -u Joe -D FooServer -p
     
    enter the password

    Works?

    Ok then now you have a database and a user for that database. Whenever you have plugins that work with mySQL use
    the database name FooServer, user Joe and password SomePassword

    Start the server, let the plugin work to create the tables in the database. Verify it did so:

    Code (Text):

    # mysql -u Joe -D FooServer -p

    (enter password)

    > show tables;
     

    In the configuration for the IP address of the mySQL server use 'localhost'
     
  4. thx for the info, but what i meant is that im running the mysql centos server at my home and the minecraft server with a shared hosting provider. i tried this on putty connected with my home machine and everything works. i've changed the mysql info in the plugin configs but they can't reach the database :/
     
  5. You would need to port foward, allow ip through iptables, or firewalld, then change the login to [email protected]<IP>
     
  6. Oh, So the mysql database is on a different network than the Minecraft server? Unless you're sitting on some big pipe --

    Doable, yes.
    Latency, yes (ouch)

    (eg., compute ping latency from your host with the mySQL server to the actual MC server. That's what it'll be like every time your server wants to poke your mySQL database. Sure your MInecraft vendor won't toss you a mysqld ? )
     
  7. Thx i alredy port forwarded, i'l look into the iptables ;)

    hmm, they only offer 1 mysql database and i need 8 :/ so that is kinda the problem.
    but i only live 300km away from the datacenter the server is hosted at and my internet is pretty fast (198mbps download and 19mbps upload) ;)
    so the latency won't be too bad (i hope) :p
     
  8. I highly suggest doing this differently. You can use your host's mysql hosting. Use one database and just have the plugins use different prefixes so there won't be any namespace overlapping. You don't need 8 separate databases. Latency will be a thing and isn't effected by your port speed. Reliability is another thing. What happens if that home server goes down? Everything relying on it will no longer be able to get data. Depending on how they're written that can be pretty bad for the server.
     
    • Informative Informative x 1
  9. What you care more about is ping time mostly, you're probably better off using what Clinton is talking about via table prefixes but if you're dead set on wanting to get it working on your home server here are a few things to try.

    1) Try connecting to the mysql server locally, eg on your home computer. (if this doesn't work you're still using the default my.cnf and not letting mysql listen for external connections).
    2) Try using a port checking tool on your external IP to make sure that the port is open. (if you've properly port forwarded then you need to contact your ISP as they're probably blocking the mysql port or change it to 3307 (or anyother port number) because lol they're probably just blocking the port number)
    3) If that doesn't work come back when I'm not drunk and I'll probably have more ideas.