Can't select database error in WordPress localhost on WAMP Server

admin

Administrator
Staff member
I’m following this Lynda.com tutorial (<em>WordPress – Building Themes from Scratch Using Underscores (2017)</em>) and haven’t gotten very far. I’ve installed a blank WordPress install on localhost using <strong>WAMP Server</strong> and I downloaded and installed the underscores theme. But for some reason when I am trying to launch the website I am getting this error:

<blockquote>
Can’t select database

We were able to connect to the database server (which means your username and password is okay) but not able to select the lynda_under17_040518 database.

Are you sure it exists?

Does the user root have permission to use the lynda_under17_040518 database?
On some systems the name of your database is prefixed with your username, so it would be like username_lynda_under17_040518. Could that be the problem?

If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.
</blockquote>

<h2>Here is what i know</h2>

<ul>
<li>The database exists and I can run SQL commands on it in phpMyAdmin.</li>
<li>My user is root</li>
<li>Host is localhost</li>
<li>Database is lynda_under17_040518</li>
<li>root has all privileges to database (as verified in phpMyAdmin)</li>
<li>Other local websites on the same WAMPServer work just fine</li>
</ul>

<a href="https://stackoverflow.com/questions...se-server-error-in-wordpress/#answer-35262780">This Stack Overflow post</a> says to put
Code:
define( 'WP_DEBUG_LOG', true );
in wp-config.php which I’ve done. It also says:

<blockquote>
“the debug.log file will be in wp-content.”
</blockquote>

I don't see any debug log even though I’ve restarted all services in WAMP and refreshed the browser.

<h2>Other Links I Consulted</h2>

I reviewed the info on these pages, but they didn't really help for my situation.

<ul>
<li><a href="https://stackoverflow.com/questions/18776473/cant-select-database-wordpress-error">can&#39;t select database wordpress error</a></li>
<li><a href="https://stackoverflow.com/questions/24801992/cant-select-database-wordpress">Can&#39;t select database - Wordpress</a></li>
<li><a href="https://acloud.guru/forums/aws-cert...L9P6rf-J/cant-select-database-wordpress-error" rel="nofollow noreferrer">https://acloud.guru/forums/aws-cert...L9P6rf-J/cant-select-database-wordpress-error</a></li>
<li><a href="https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/" rel="nofollow noreferrer">https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/</a></li>
<li><a href="https://serverfault.com/questions/2...users-that-can-access-a-database-mysql/263936">https://serverfault.com/questions/2...users-that-can-access-a-database-mysql/263936</a></li>
</ul>

Where is my debug log and how can i get my local website running?