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 ?
Step 1 )
Step 2 )
Step 3)
Open your wordpress folder and look this
wp-config-sample.php
renamewp-config-sample.php
towp-config.php
Step 4 )
and open rename file
wp-config.php
and Pastestep 3
code and save this fileStep 5 )
After save wp-config.php don't refresh only click "Run the Install"
step 6)
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.Try to add database in the phpmyadmin and change the
wp-config-sample.php
towp-config.php
and provide your username, password and database name...like
Reference word-press installation