Welcome to WebmasterWorld Guest from 184.73.3.107

Forum Moderators: open

Database lost!

   
11:31 am on Jan 26, 2009 (gmt 0)

5+ Year Member



I have some php scripts editing, updating and reading from a database that is on my server.
Previously I could use webmin to have a look at the tables etc, but after an OS reinstall this database does not show up in either cPanel or phpmyadmin. The scripts work fine so the db is there, but I cannot edit/manage it.
Any ideas?
1:02 pm on Jan 26, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



is phpmyadmin/cpanel connecting to the right mysql-server?
I know phpmyadmin has a function to restrict access to certain databases, maybe the one you "lost" is not in that list?
2:01 pm on Jan 26, 2009 (gmt 0)

5+ Year Member



well the server is described as 'localhost' in both my code:

$con = mysql_connect("localhost","$dbusername","$dbpasswd") or die

and in phpmyadmin: ' Server: localhost'

but as I say, there is no sign of my dbase. How do I check the 'restrict access' list you mention?

2:13 pm on Jan 26, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



that'd be in the config-file of phpmyadmin. also: localhost is just "this machine", so if phpmyadmin runs on another machine than your scripts, localhost would mean different boxes ...
in phpmyadmin, choose some database, go to sql (where you can run your own queries) and run "SHOW DATABASES"

it should list all the databases on the host. IIRC, even if a user is not allowed to access a certain database, he should still see it. so if your database doesn't show up there, you're looking at two different servers.

5:12 pm on Jan 26, 2009 (gmt 0)

5+ Year Member



well AFAIK phpmyadmin is running on the same server. It has to be, right? I get to it through cpanel which is definitely on the same server.

When I tried that SHOW DATABASES I just got the same list as on the phpmyadmin home page.

8:07 am on Jan 27, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



I'm not familiar with cpanel, but I just tested and found out I was wrong, a user can only "see" the databases he's allowed to access (guess the "see all"-thing was mysql 3.x or 4.x, I remember it was there at some point...) so maybe the user you're using in phpmyadmin is just not allowed to access the database?
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month