Database is available on phpmyadmin but django say "Unknown database 'expenses'".

In phpmyadmin, there is a database name " expenses " but django don’t find out this .the screenshot of phpmyadmin is given below:

Screenshot from 2021-02-04 19-04-17

And the error is given below :
django.db.utils.OperationalError: (1049, “Unknown database ‘expensesdb’”)

For kind your information : when I wanna to show the all database list using mysql>show databases; command on terminal then it can’t show all of my database . It just show only 3 database . But I have more than 10 database available in phpmyadmin.

so what’s the wrong with that?

If phpadmin is showing one list, but the MySQL command show databases shows you something different, I’m not sure how this is in any way related to Django.

Regardless, my first guess would be some type of permissions issue. Check your phpadmin installation to see what credentials are being used to access the database and verify you’re using the same credentials when you connect using the command line.
Also, is it possible that phpadmin is listing databases from either multiple instances of MySQL? (Multiple instances on the same server or databases from multiple servers? I don’t know phpadmin well enough to know how it handles that case.)

1 Like