0

I'm trying to get the database dump (.sql) of a remote site to work with my local setup. Sort of like migrating from remote to local. I've already ftp-ed the site itself, but having problems transferring database.

The database on the remote has "db_name" database name, "username", and "password". I've replicated all those and it works fine when the database is empty. I get the setup screen to setup my new site on localhost. So the database connection is working fine.

But soon as I restore the database from the dump (mysql -u root < dump.sql) and try to access the site, it throws the "Error establishing a database connection" error.

Why does it throw that error when I know for a fact that couldn't possibly be the problem!

Any ideas?


I've captured the logs fresh for both cases for clarity by deleting previous ones and restarting the respective services. As such they're almost identical and unfortunately don't reveal anything..

  • When not working

    ^ Not working when the backup is loaded:

    • mysql_error.log

      2014-09-21 09:42:43 5008 [Note] Plugin 'FEDERATED' is disabled.
      2014-09-21 09:42:43 5008 [Note] InnoDB: The InnoDB memory heap is disabled
      2014-09-21 09:42:43 5008 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
      2014-09-21 09:42:43 5008 [Note] InnoDB: Compressed tables use zlib 1.2.3
      2014-09-21 09:42:43 5008 [Note] InnoDB: Not using CPU crc32 instructions
      2014-09-21 09:42:43 5008 [Note] InnoDB: Initializing buffer pool, size = 20.0M
      2014-09-21 09:42:43 5008 [Note] InnoDB: Completed initialization of buffer pool
      2014-09-21 09:42:43 5008 [Note] InnoDB: Highest supported file format is Barracuda.
      2014-09-21 09:42:44 5008 [Note] InnoDB: 128 rollback segment(s) are active.
      2014-09-21 09:42:44 5008 [Note] InnoDB: Waiting for purge to start
      2014-09-21 09:42:44 5008 [Note] InnoDB: 5.6.15 started; log sequence number 1626464
      2014-09-21 09:42:44 5008 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
      2014-09-21 09:42:44 5008 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
      2014-09-21 09:42:44 5008 [Note] Server socket created on IP: '127.0.0.1'.
      
    • error.log

      [Sun Sep 21 09:36:31.214571 2014] [mpm_winnt:notice] [pid 3508:tid 352] AH00455: Apache/2.4.7 (Win32) PHP/5.5.8 configured -- resuming normal operations
      [Sun Sep 21 09:36:31.214571 2014] [mpm_winnt:notice] [pid 3508:tid 352] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
      [Sun Sep 21 09:36:31.214571 2014] [core:notice] [pid 3508:tid 352] AH00094: Command line: 'C:\\LOCALH~1\\PHP\\EasyPHP\\binaries\\apache\\bin\\eds-httpd.exe -d C:/localhost/PHP/EasyPHP/binaries/apache'
      [Sun Sep 21 09:36:31.217572 2014] [mpm_winnt:notice] [pid 3508:tid 352] AH00418: Parent: Created child process 3536
      [Sun Sep 21 09:36:32.163692 2014] [mpm_winnt:notice] [pid 3536:tid 324] AH00354: Child: Starting 64 worker threads.
      
    • access.log

      127.0.0.1 - - [21/Sep/2014:09:36:33 +0530] "GET / HTTP/1.1" 500 423
      127.0.0.1 - - [21/Sep/2014:09:37:18 +0530] "GET / HTTP/1.1" 500 423
      127.0.0.1 - - [21/Sep/2014:09:37:40 +0530] "GET / HTTP/1.1" 500 423
      127.0.0.1 - - [21/Sep/2014:09:42:56 +0530] "GET / HTTP/1.1" 500 423
      127.0.0.1 - - [21/Sep/2014:09:43:29 +0530] "GET / HTTP/1.1" 500 423
      
  • When working

    All I have to do is delete the database (or just rename the table)

    • mysql_error.log

      2014-09-21 09:59:09 4652 [Note] Plugin 'FEDERATED' is disabled.
      2014-09-21 09:59:09 4652 [Note] InnoDB: The InnoDB memory heap is disabled
      2014-09-21 09:59:09 4652 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
      2014-09-21 09:59:09 4652 [Note] InnoDB: Compressed tables use zlib 1.2.3
      2014-09-21 09:59:09 4652 [Note] InnoDB: Not using CPU crc32 instructions
      2014-09-21 09:59:09 4652 [Note] InnoDB: Initializing buffer pool, size = 20.0M
      2014-09-21 09:59:09 4652 [Note] InnoDB: Completed initialization of buffer pool
      2014-09-21 09:59:09 4652 [Note] InnoDB: Highest supported file format is Barracuda.
      2014-09-21 09:59:09 4652 [Note] InnoDB: 128 rollback segment(s) are active.
      2014-09-21 09:59:09 4652 [Note] InnoDB: Waiting for purge to start
      2014-09-21 09:59:09 4652 [Note] InnoDB: 5.6.15 started; log sequence number 1626484
      2014-09-21 09:59:10 4652 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
      2014-09-21 09:59:10 4652 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
      2014-09-21 09:59:10 4652 [Note] Server socket created on IP: '127.0.0.1'.
      
    • error.log

      [Sun Sep 21 09:59:09.516571 2014] [mpm_winnt:notice] [pid 12012:tid 468] AH00455: Apache/2.4.7 (Win32) PHP/5.5.8 configured -- resuming normal operations
      [Sun Sep 21 09:59:09.516571 2014] [mpm_winnt:notice] [pid 12012:tid 468] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
      [Sun Sep 21 09:59:09.516571 2014] [core:notice] [pid 12012:tid 468] AH00094: Command line: 'C:\\LOCALH~1\\PHP\\EasyPHP\\binaries\\apache\\bin\\eds-httpd.exe -d C:/localhost/PHP/EasyPHP/binaries/apache'
      [Sun Sep 21 09:59:09.552575 2014] [mpm_winnt:notice] [pid 12012:tid 468] AH00418: Parent: Created child process 7656
      [Sun Sep 21 09:59:11.559831 2014] [mpm_winnt:notice] [pid 7656:tid 320] AH00354: Child: Starting 64 worker threads.
      
    • access.log

      127.0.0.1 - - [21/Sep/2014:10:00:04 +0530] "GET / HTTP/1.1" 302 161
      127.0.0.1 - - [21/Sep/2014:10:00:04 +0530] "GET /wp-admin/install.php HTTP/1.1" 200 4298
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-includes/js/jquery/jquery.js?ver=1.10.2 HTTP/1.1" 200 93091
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1 HTTP/1.1" 200 7200
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-includes/css/buttons.min.css?ver=3.8.4 HTTP/1.1" 200 5354
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-admin/js/user-profile.min.js?ver=3.8.4 HTTP/1.1" 200 2268
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-includes/js/zxcvbn-async.min.js?ver=1.0 HTTP/1.1" 200 324
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-admin/js/password-strength-meter.min.js?ver=3.8.4 HTTP/1.1" 200 737
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-admin/css/install.min.css?ver=3.8.4 HTTP/1.1" 200 3987
      127.0.0.1 - - [21/Sep/2014:10:00:07 +0530] "GET /wp-admin/images/wordpress-logo.svg?ver=20131107 HTTP/1.1" 200 1521
      127.0.0.1 - - [21/Sep/2014:10:00:08 +0530] "GET /wp-includes/js/zxcvbn.min.js HTTP/1.1" 200 698775
      
  • make sure mysql username/password used in wp-config.php is correct and the user have access to database. – Robert hue Sep 20 '14 at 8:44
  • @Roberthue I have. Like I said, when the database is empty it all works fine. – laggingreflex Sep 20 '14 at 8:50
  • Have you checked the error_log? – Tomás Cot Sep 20 '14 at 13:13
  • @TomásCot This might sound noobish but which error_log? I'm using EasyPHP on windows and it offers a mysql_error.log and apache error.log & access.log. I've added all their contents for both cases in the question. – laggingreflex Sep 21 '14 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.