6

I'm trying to build a database for my server in phpmyadmin but when I finish building it I can't access it using PHP and it won't show when I list the databases in MySQL. But when I create a database in mySql it shows up in phpmyadmin. Also I'm running phpmyadmin version 4.0.3, and theres a statement at the bottom of the page saying The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.

Thanks!

7
  • Dont worry just refresh your phpmyadmin via F5 or browser refresh and you should be able to see databases. Make sure you are logged in with user account that has access to databases you are referring to. Commented Jan 3, 2014 at 17:39
  • I can already see the databases in phpmyadmin, its in MySQL and trying to access them in PHP that I can't. Commented Jan 3, 2014 at 17:42
  • ANy chance they are being created in a different schema in your database when creating through PHPmyAdmin? Commented Jan 3, 2014 at 17:47
  • I'm not really sure, is there anyway I can check? Commented Jan 3, 2014 at 17:55
  • Not sure if I can answer that for MySQL...the sys tables are different and I lack a MYSQL environment. Are you using workbench for MYSQL? If so, I beleive you can list off the tables and schemas in the navigation panel there. Commented Jan 3, 2014 at 18:00

4 Answers 4

17

I just had the problem, and realized that I was creating database with names with '_test' suffixes.

It happens that phpmyadmin has a feature to hide some DBs. To change that behaviour, you can navigate to : settings > features > general > Hide databases

By default, hiddent databases have these patterns : information_schema|mysql|performance_schema|test|phpmyadmin

Sign up to request clarification or add additional context in comments.

1 Comment

In my case, I tried to create a database with name test2 and it got also hidden. When I removed 'test' from the patterns, I was able to access it.
12

If you Still don't see it, Try to logout and then log in again to cPanel or PHPMyAdmin. It worked for me.

Comments

6

This sounds like a permissions issue. I'd guess that your phpMyAdmin is connecting to MySQL as root (or another user with the superuser privilege) and can therefore see all databases. Your app is probably connected using a different, lower privileged user.

Try running select user(); from your app and from phpMyAdmin and you will know for sure.

Assuming your app is running with a different user, you will need to add privilages for it to access the database you create. Please read the section titled Assigning privileges to user for a specific database in the phpMyAdmin documentation.

3 Comments

I'm connecting using the PHP mysql_connect function and logging in with the same account. But when accessing mysql from terminal I'm not sure which account its using. I checked the privelages for the root user using the link you sent and it says that there are 4 root accounts but all of them have "ALL PRIVILEGES"
Found out I wasn't accessing mysql via the root account, just logged in as root and all of the databases showed up. Still trying to figure out why they're not being shown in PHP, can I change the permissions on a database?
It is best practice not to log in as root from your app (that way if someone hacks into your server they won't get your root pwd by looking at your app source). You can use the GRANT command to add privilages. For example GRANT ALL ON db1.* TO 'jeffrey'@'localhost';. See the MySql documentation for GRANT
0

This is pure permission issue. If you logged in without specifying the user, you won't see all the databases just like @t3po7re5 mentioned. What you should do is specify root user in your command.

mysql -uroot -p

It will prompt you to then enter the password. this is the default password if you have not specified or changed the default root password depending on the local server you are using.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.