• Resolved Eric Hepperle

    (@codeslayer2010)


    I’m following a Lynda tutorial (WordPress – Building Themes from Scratch Using Underscores (2017)) and haven’t gotten very far. I’ve installed a blank WordPress install on localhost using WAMP 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:

    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.

    Here is what i know

    • The database exists and I can run SQL commands on it in phpMyAdmin.
    • My user is root
    • Host is localhost
    • Database is lynda_under17_040518

    This Stack Overflow post says to put define( 'WP_DEBUG_LOG', true ); in wp-config.php which I’ve done. It also says:

    “the debug.log file will be in wp-content.”

    Well, I am not seeing any debug log even though I’ve restarted all services in WAMP and refreshed the browser.

    Any ideas on what is going and how to get my local website working again?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    WP_DEBUG_LOG has no effect unless WP_DEBUG is also defined as true. The error log is where ever PHP logs errors according to php.ini directives, it’s typically not wp-content unless you’ve taken steps to make it so.

    Verify that the DB_USER defined in wp-config.php is indeed “root”. Apparently so, but it’s good to check. Get into phpMyAdmin. If General Settings is not shown, click on Server: localhost at the top, then select User Accounts tab. Find the row for root on localhost. If it doesn’t say ALL PRIVILEGES, go to edit privileges.

    Assign all privileges and click Go. If you want to experiment with limited privileges, do so later after it’s all working. Click the Database button near the top. Your WP DB should NOT be listed. If it is, assign all privileges again, then check for any specific table privileges. There shouldn’t be, but if so, edit again and assign all privileges.

    Thread Starter Eric Hepperle

    (@codeslayer2010)

    Thanks for your reply @bcworkz.

    Everything you mentioned I had already done. After posting this — and before you answered — I posted the same issue to Stack Overflow, hoping to maximize my chance of getting a quick response, with slightly different wording, and with the added information that I had completed those steps already. Unfortunately, none of that solved it.

    But, the solution was found! As SO user @michaelw suggested I shortened the database name and that solved it. Read more here: https://stackoverflow.com/questions/53402470/cant-select-database-error-in-wordpress-localhost-on-wamp-server?noredirect=1#comment93682675_53402470

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t select database error on WAMP localhost’ is closed to new replies.