Reputation: 51
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.
Upvotes: 1
Views: 10259
Reputation: 1
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.
Upvotes: 0
Reputation: 51
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...
Upvotes: 5
Reputation: 17561
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
Upvotes: 2