Have you also adjusted the prefix in wp-config.php accordingly?
$table_prefix = ‘wp_’;
Thanks for response. This is how it is in production config. It is also how it is in dummy wordpress install on localhost so I left it alone. Seems that it just doesn’t want to recognise my imported database. I am using root/root as user credentials as production creds don’t work anyway
If it is not, it is the access data to the database that is wrong. Double check them.
root has global prieveledges on all databases but I agree that this seems to be the issue . . . . .
Do you have to perform a WP install for a new database? I was rather thinking that you could just use your production directories (and change wp-config). I ask this becasue if I do perform a WP install, it creates a database as part of the install (with nothing in it so to speak).
No, that is not necessary. The database must be accessible. If I have something like that, I try to log in via console with the stored access data. Then I can usually see the reason (e.g. missing access rights, wrong password, wrong port, firewall …). Nowadays, root access is usually not possible even with MySQL, so this could well be a reason.
Thanks. Will give it a go tomorrow
From another forum, I found that by adding the following to the foot of wp-config, that I now get a connection, but it is not formatted. More of an outline. Also I get 404 error when trying to access wp-admin ????
What WP subdirectories should I keep from production site, and which from a clean WP install (if any). I think this is what I am struggling with
/** Sets up WordPress vars and included files. */ define(‘WP_CACHE’, true); $currenthost = $_SERVER[‘HTTP_HOST’]; $mypos = strpos($currenthost, ‘localhost’); if ($mypos === false) { define(‘WP_HOME’,’http://YOURSITE.com’); define(‘WP_SITEURL’,’http://YOURSITE.com’); } else { define(‘WP_HOME’,’http://localhost:8888′); define(‘WP_SITEURL’,’http://localhost:8888′); }
All sorted. Needed to put the wordpress directory in the statements for WP_HOME and WP_SITEURL e.g.
define(‘WP_HOME’,’http://localhost:8888/YourProjectDirectory’);
Thanks @threadi for responding, and giving me the inspiration to continue debugging. Was getting close to jacking it in.