MySQL error "No database selected"

I am using LAMP on localhost . I can log into a system that is using mysql db, go to the main page (data driven), but when I enter that particular page it is ok, but when I update the error "no database selected" then every page says so ...

I have restarted Apache server, MySQL

Browsers FF, IE, Chrome all show the same errors, also clears the cache. In the meantime, other websites that use the same LAMP server work fine.

Now that is strange

Any ideas are appreciated.

0


a source to share


4 answers


Are master pages used with mysql_select_db("foo")

, not for this?



0


a source


When you connect to php, you are not selecting the database (or no selection is made). Perhaps it is using a variable that is not populating properly?



0


a source


Somewhere in the code (PHP) the default database gets reset, possibly in conjunction with a shared database. I am assuming this is a bug in the product you are using.

0


a source


Try using code where it connects to the database and tries to pull the data. In most cases, there is a config file that also defines the connection attributes such as username, password, database server, port, and database.

for example in phpMyAdmin stores information in libraries / Config.class.php file.

0


a source







All Articles