Can't select database - Wordpress

前端 未结 12 931
醉话见心
醉话见心 2021-01-05 15:38

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

相关标签:
12条回答
  • 2021-01-05 16:01

    If using LAMP -

    Make sure that all privileges are granted for that database to the created mysql user. Under your MYSQL shell use the below

    GRANT ALL PRIVILEGES ON database_name.* TO database_user@localhost IDENTIFIED BY 'user_password';
    

    Where,

    database_name = your database name as per wp-config.php

    database_user = your user name as per wp-config.php

    userpassword = your user password as per wp-config.php

    0 讨论(0)
  • 2021-01-05 16:02

    my problem was that when I granted permissions to the DB user the host did not match what was in the wp_config.php

    /** MySQL hostname */
    define('DB_HOST', 'localhost:3306');
    

    I was granting rights with

    GRANT ALL ON databaseName.* TO 'UserName'@'127.0.0.1';
    

    This gave me access when I was connected to the local host through ssh but It did not match wp_config.php. so I had to Grant like this then it all worked.

    GRANT ALL ON databaseName.* TO 'UserName'@'localhost';
    
    0 讨论(0)
  • 2021-01-05 16:03

    Verify the wp-config.php file. I had the same error and the problem was related with the quotes: ‘root’ vs 'root'

    edit: the correct one is single quote

    '
    
    0 讨论(0)
  • 2021-01-05 16:03

    By default

    username : root

    password : leave it blank

    database host : localhost

    table_prefix : wp_

    0 讨论(0)
  • 2021-01-05 16:03

    please create your database with name 'wordpress' before installing wordpress

    0 讨论(0)
  • 2021-01-05 16:06

    It took me way too long to discover that my msql databases were not working on any other websites either. I reinstalled Wamp Server and it worked.

    0 讨论(0)
提交回复
热议问题