IP Change and now site can't connect to MySQL

Discussion in 'Installation/Configuration' started by scottrill2, Mar 3, 2014.

  1. scottrill2

    scottrill2 Member

    Hello folks,

    My vps's were migrated to a new server and with that came new IP's. I have a multiserver setup using:

    apache server
    nginx server
    mysql server

    Everything was running flawlessly. However, my host needed to migrate my vps's to a new machine and also changed my IP address.

    I have:


    1. changed the IP addresses at registrar for the sites.
    2. Under System> Server configuration I have changed the IP there as well.

    However no matter whether I try to connect to an apache site or a nginx site, Joomla says:

    Database connection error (2): Could not connect to MySQL.


    However ISPConfig shows server state as having 45 days of uptime (Since last time I restarted it) And this obviously can't be since the server was migrated so I am thinking somehow ISPConfig isnt communicating with the mysql vps either


    How should I begin to troubleshoot this?



    **EDIT** I forgot to mention I can both ping and traceroute the mysql vps. I can also connect via SSH so I know IP is correct etc.


    As always thanks for the help folks,



    Scott
     
    Last edited: Mar 3, 2014
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check that you changed the ip addresses also in /etc/hosts and in in mysql. Take a look at all records in all tables of the mysql "mysql" databases on all servers and replace the old IP addresses by the new ones in all places they occur. Then restart mysql or run "Flush privileges" command. before you alter the mysql tables, make a backup :)
     
  3. scottrill2

    scottrill2 Member

    Awesome as always.

    Thanks Till,

    Awesome responses as always. I double checked the main ISPConfig servers host file and the changes hadn't saved. I redid it again, and it is working now, but still behaving weird.

    Questions:

    1. What would be the best way to search the mysql "mysql" tables? PhpMYadmin or is there something better built into Debian or ISPConfig?



    I only noticed this next problem because of this issue. My hosts file and also network interfaces arent saving changes I make verbatim?

    /etc/network/interfaces

    Per my provider my subnet mask should be:

    255.255.254.0

    I am entering this and the gateway ip given to me, however upon restart the subnet mask goes to:

    255.255.255.255

    And the gateway info just vanishes completely.


    /etc/hosts

    My hosts file looks correct for the OTHER servers in the multiserver setup. But it itself just displays name not the fqdn.


    xxx.xxx.xx.xx mysql1.example.com mysql1
    xxx.xxx.xx.xx nginx1.example.com nginx1
    127.0.0.1 localhost.localdomain localhost
    # Auto-generated hostname. Please do not remove this comment.
    xxx.xxx.xx.xx apache1
    ::1 localhost

    Regardless of whether I type into hosts file or do:

    echo apache1.example.com > /etc/hostname
    /etc/init.d/hostname.sh start

    hostname and hostname -f both show the short version.


    I did just do a bunch of updates, is this the new normal settings?


    Thanks as always folks,

    Scott Cottrill
     

Share This Page