Can't select database - Wordpress

前端 未结 12 930
醉话见心
醉话见心 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 15:40

    Please don't overcomplicate.

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

    0 讨论(0)
  • 2021-01-05 15:41

    For me, the solution was giving wp_user all permissions on the wp_db database.

    I achieved this using the command line interpreter (CLI):

    $ mysql -uroot -p
    MariaDB [(none)]> GRANT ALL ON `wp_db`.* TO `wp_user`@`localhost` IDENTIFIED BY 'pass';
    MariaDB [(none)]> exit;
    

    After these operations, I restarted the database:

    $ systemctl restart mysql
    

    Of course, the database name (wp_db), username (wp_user), and password of the user (pass) can be different.

    0 讨论(0)
  • 2021-01-05 15:44

    I had this issue when trying to transfer databases between WAMP server installations.

    I tried opening PhpMyAdmin on new PC, then got the port of MySql server (:3308) and added this port into DB_HOST ('localhost:3308'). This worked for me.

    0 讨论(0)
  • 2021-01-05 15:47

    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.

    0 讨论(0)
  • 2021-01-05 15:55

    It sounds like either you have not created a database or your wp-config file is not set up correctly. Have you edited wp-config.php file of wordpress and provided correct database name and user credentials. See Famous 5 minute installation of wordpress for details.

    0 讨论(0)
  • 2021-01-05 15:56

    For Mariadb hostname should be localhost:3306 and for MySQL localhost:3308.this fixed my error.

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