PhpMyAdmin and Mysql databases [closed]

2019-10-03 04:19发布

I installed wordpress on localhost and made database - wordpress un phpmyadmin.

When I try to connect wordpress database through terminal, it shows that there is no such database - wordpress but mysql, information_schema,performance_schema,test.

Why it is like that and how can I fix it ?

3条回答
不美不萌又怎样
2楼-- · 2019-10-03 05:00

add database in the phpmyadmin ex. text

enter image description here

Install Wordpress steps


Step 1 )

enter image description here


Step 2 ) enter image description here


Step 3)

enter image description here

Open your wordpress folder and look this wp-config-sample.php rename wp-config-sample.php to wp-config.php


Step 4 )

enter image description here

and open rename file wp-config.php and Paste step 3 code and save this file

Step 5 )

enter image description here

After save wp-config.php don't refresh only click "Run the Install"


step 6)

enter image description here

Enjoy Install Your Wordpress

查看更多
Viruses.
3楼-- · 2019-10-03 05:05

So you see the database from within phpMyAdmin and want to know why you can't see it from the command line (terminal); this appears to be because you're not connected as the same user. Even if you're connected as the same user name, if one user is connected via sockets and the other through the TCP/IP connection it would explain the problem because MySQL treats different incoming hosts and connection types as different users.

To check this, look at the main page of phpMyAdmin, on the right side where it shows "Server" and "User" listed under the Database server section. Then connect from the command line client and run the status; command, and compare the output.

To fix it, either connect as the correct user (the -u and -h options may be helpful here), or grant the proper permissions to the user you're connecting as from the command line.

查看更多
一夜七次
4楼-- · 2019-10-03 05:10

Try to add database in the phpmyadmin and change the wp-config-sample.php to wp-config.php and provide your username, password and database name...

like

/** The name of the database for WordPress */
define('DB_NAME', 'test');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'test');

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

Reference word-press installation

查看更多
登录 后发表回答