Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't select database - Wordpress

When I download a new wordpress from wordpress.org and then paste it into my www folder of WAMP, then create a new database in phpmyadmin, then go to localhost and click the wordpress site, it asks to create the config file, and enter the database details, and i do that correctly, but when I click submit, it says "Can’t select database".

Any Idea why this is?

I already have a local wordpress site that started saying error connecting to database. The config settings are all correct so i tried to download a fresh wordpress site and use it and I cannot even set up a fresh one. I have never encountered a fresh wordpress site not working like this before.

I did a msqldump of my old site so that my boss could put it on his server. Not sure if that is relevant.

Cheers.

like image 769
user3164083 Avatar asked Jul 17 '14 11:07

user3164083


2 Answers

Please don't overcomplicate.

In the "Database Host" field add "localhost: e.g. in my case "localhost:3308" solved the problem.

like image 50
Rajwant Avatar answered Oct 12 '22 05:10

Rajwant


For anyone who's still looking for solutions to this problem - please, check again your wp-config.php database credentials again. I had the same problem today and tried to over-complicate the matter by searching for advanced solutions, while I had a space in my DB_NAME field (was supposed to be 'wpdb' and was ' wpdb').

This space completely messed up my connection, I was even close to reinstalling the whole thing and losing all data.

like image 44
Vladimir Marton Avatar answered Oct 12 '22 04:10

Vladimir Marton