1

I could not find an answer. Have a production website with production DB. Have backed up the DB and restored to a development environment where I also created a development website in the same server, same cPanel, same user and same password for both DBs. Is a Magento platform 1.9.2, although I do not think is important. Here is the issue: I can execute SQL in the development DB but the same SQL sentence would not execute in the production DB. Also I have uploaded WP to the development and isntalled using the development db for the magento installation, but when I try to run the WP installation for the production site, WP replies "We were able to connect to the database server". Remote MySQL, firewall, etc are the same for both DB, what could be the cause of this and how do I solve it? Thank you.

markratledge
  • 17,322
  • 12
  • 60
  • 106
EddyK
  • 51
  • 1
  • 2
  • 5
  • Check the connection details in your `wp-config.php`; if they look OK, check the server's PHP logs to see if there's anything obvious. – Hobo Feb 08 '16 at 03:39

3 Answers3

5

Right Click on the instance of WAMP, then under tools click on "invert default DBMS".

May not work in all cases, but simple and quick to try...

Kirby M
  • 51
  • 1
  • 1
2

The error We were able to connect to the database server means WP can connect to the database, but the user or password or permissions are wrong.

Are you sure database user in wp-config.php has adequate permissions for the database? Try giving the user all privileges, i.e. SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES for the database.

And, try WP_DEBUG to find any php errors that may indicate other connection issues.

Add

define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true );

in wp-config.php and the debug.log file will be in wp-content.

And optionally add this

define( 'WP_DEBUG_DISPLAY', true);

to wp-config.php to log and dump them to the browser.

See https://codex.wordpress.org/WP_DEBUG

markratledge
  • 17,322
  • 12
  • 60
  • 106
  • Thank you @markratledge , I'm following the wp installation and I'm using the username and password copied from the local.xml in my Magento installation for that DB, which works poerfect and has all privileges and pasted to the installation box here is a screenshot [link](http://prntscr.com/a0zwvm) after submit [link](http://prntscr.com/a0zyxe) . Is weird, because I have installed to sub-domain where the development site is, using the same username and password. As I said, the development site DB was restored from the production site backup. Both websites work fine. – EddyK Feb 09 '16 at 15:05
  • I only see the wp-config-sample.php . I want to use the same DB I have for Magento usin g wp_ as prefix to the wp tables. If I change the name to wp-config.php and proceed as per your instructions will the wp_ tables be created? – EddyK Feb 09 '16 at 15:06
  • So there is no wp-config.php file? – markratledge Feb 09 '16 at 15:46
  • no until the installation is complete if following the wordpress installation. Anyways, I have decided to go another path and created a new DB for the blog added the same user I was using before and followed the installation with no issues. Although I still don't know why the Magento DB could not be selected, it works and I could close the question now. I thank you very much for your help. – EddyK Feb 10 '16 at 16:21
0

Another potential issue is that the DB_USER has not been assigned privileges' to the database even though the people with this problem know the valid username and password as well knows the valid database name. The wp-config.php field values for the DB_NAME, DB_USER, and DB_PASSWORD may be correct. The problem may have been caused when the user renamed the Database which causes a DROP and CREATE process for the database. Sometimes the renaming of the database is done in the phpMyAdmin tool and creates the problem. Users who's web hosting service uses cPanel, phpMyAdmin and 'MySQL Databases' apps can simply "Add User to Database" using the cPanel's "MySQL Databases" That app provides dropdown lists of existing users and databases. During the process of associating the user to the database will also allow you to assigning user privileges to the database. Selecting "All" privileges will work if that is what is desired.

Zinnware
  • 1
  • 1