Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Posts
    23
    Plugin Contributions
    0

    Default Can't connect to database after server move

    Within the same hosting company, Dreamhost, I moved a Zencart installation from a shared server to a VPS. I had to change the username, which changed the path. I updated this in the configure.php files in Includes and in admin/includes. The database connection did not change, and we tested it and it still connects outside of Zencart.

    Now I get this message:

    "Sorry!
    There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you."

    The hosting company says everything should work, and they have no idea what's wrong. I even tried changing the database username, but that didn't help.

    Any ideas?
    Thanks.

    carbideemporium.com
    Zencart 1.5.5
    PHP 5.6

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Can't connect to database after server move

    Considering that you switched from one "server" to another, did the ip address per chance change? Is the database user authorized to access the database from the "new" server?

    Click on the username for the applicable database(s) and should be presented with the acceptable list of "sources" from which that user can access the database... might fix the issue. And if it does, I'm disappointed in the support that was offered, if not, I'm a bit stumped as well other than also trying to create a new server "host" and then transfer the database or similar actions.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

    Default Re: Can't connect to database after server move

    see:

    https://www.zen-cart.com/content.php...o-our-database

    the problem is almost definitely in your configure.php file.

    i'm not sure how dreamhost does their vps. but on their shared server, they separate the db server from the web server. so frequently in the configure.php, you have a value other than localhost for DB_SERVER. i would examine very closely the following constants:

    Code:
    define('DB_TYPE', 'mysql'); // always 'mysql'
    define('DB_PREFIX', ''); // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET', 'utf8'); // 'utf8' or 'latin1' are most common
    define('DB_SERVER', 'localhost');  // address of your db server
    define('DB_SERVER_USERNAME', 'username');
    define('DB_SERVER_PASSWORD', 'password');
    define('DB_DATABASE', 'db_name');
    if you can connect outside of ZC, there is no reason why you should not be able to connect within ZC.

    good luck.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Can't connect to database after server move

    I even tried changing the database username.
    I read that as "Had to create a new database user." and then wonder if permission to access the database was also given. As it is a separate step after creating a new database user, it is easy to overlook.

  5. #5
    Join Date
    Aug 2004
    Posts
    23
    Plugin Contributions
    0

    Default Re: Can't connect to database after server move

    Thanks for the help. I asked the third DH support person if the new server had permission to access the db. He then fixed it right away.

 

 

Similar Threads

  1. v139h after move server why clients can't pay by paypal ?
    By dmagic in forum General Questions
    Replies: 6
    Last Post: 27 Mar 2014, 10:31 PM
  2. no database after server move
    By skipper_2 in forum Installing on a Linux/Unix Server
    Replies: 15
    Last Post: 10 Jan 2011, 06:17 PM
  3. Can access admin after server move.
    By Dale Thomas in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 24 Apr 2007, 05:00 AM
  4. email can not receive after move server
    By sunriseimports in forum General Questions
    Replies: 20
    Last Post: 2 Apr 2007, 09:16 PM
  5. Can't see images after server move
    By san_san in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 11 Aug 2006, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg