Why Does Mysql Show A Database But Phpadmin (And Yii) Cannot See It?

I am using the advanced template and have run into an issue that I cannot work out at all.

I used the mysql command in a terminal in linux to create a database called "yii2tradematedb", we can see that it exists in the mysql terminal:

I used the

command to successfully have yii2 create its tables in that database:

When I browse to the web frontend the default index file displays perfectly. But when I try to go to the backend I get:

This is puzzling for me because the

managed to find the database and to create tables in it.

What puzzles me further is that if I use the phpadmin which came with the standard xampp package I installed, the database ‘yii2tradematedb’ does not show up there either.

Does anybody have any suggestions?


Following this stackoverflow question…

In mysql on the Linux terminal:

mysql> select user(); show databases;


| user() |


| root@localhost |


1 row in set (0.00 sec)


| Database |


| information_schema |

| mysql |

| performance_schema |

| test |

| tradematedb |

| yii2tradematedb |


6 rows in set (0.00 sec)

In phpadmin I have the same user, root@localhost, but a different Database list:









Does anybdy know what is going on here? Why is the mysql program seeing a different set of databases to the phpadmin and yii? How did yii manage to create a database in the place that mysql can see but cannot then find it in the backend view?

Is there only one mysql on any given host or has phpadmin installed its own onw which is independent of the mysql in the termina. Very confused!


I am spending all my time trying to work out why phpmyadmin (and therefore yii) cannot see the database which the mysql command in the terminal can see. I have spent hours reading stack overflow etc, desperately trying to understand what phpmyadmin is looking at when it lists its databases and what mysql is looking at when it lists its databases, but I just can’t work it out.

This is not really a yii issue, yii is working. I think there is a problem with my linux configuration.

The thing is, "yii migrate" can definitely see the database because it creates tables inside it, but the backend and phpmyadmin cannot, loading the page http://localhost/trademate/backend/web/index.php?r=site/login

fails on line 319:

It is even more strange because the "yii migrate" command runs the same script /opt/lampp/htdocs/trademate/vendor/yiisoft/yii2/db/Connection.php to do its stuff. So how come they are not seeing the same databases?

I just cannot work out why "yii migrate" is using the same thing (whatever that thing is called) that the mysql terminal command is using, but that the backend and phpmyadmin are using a different thing (I have no idea what the thing is, it is whatever stores the list of databases I guess). I thought that there was just one instance of mysql running on the computer and that both mysql and phpmyadmin connect to the same thing and that changes made with one would be visible from the other.

Is that correct or are there two different instances of some thing (maybe different things) running on my computer?

I installed xampp and used "apt-get install mysql" following what seemed like pretty standard instructions. Have they installed two seperate database systems which cannot see each other?


I started again with a brand new install of linux, this time Ubuntu Server 14.04 LTS instead of the desktop version. The mysql server and php5.5 are already installed on that. On that install databases created in mysql are visible in phpmyadmin and vice-versa. I have no idea why this was not the case in my desktop install which is now abandoned.