Can't access database MySQL

I created a Virtual Server, and added 3 Databases for it. I went in to "Edit Databases" and checked the User Name, and Password, then I went into all 3 configuration files to access all 3 databases to make sure it had the right credential. They were a 3 setup right. I have done this many times before, so I know how to do it.

But for some reason it just won't connect to any of them. I even installed "phpmyadmin" to see if it would connect, but it won't ether. I deleted all 3 databases, and reinstalled them 5 time, still will not work. Looking it the "Virtualmin/Logs and Reports/ Apache error Log", I don't see anything about an error for the databases connection.

I guess I could delete the Virtual Server, and then create it again, and all 3 Databases. That is what I had to do in the past, and then it would work, but there must be another way to figure out what it wrong. Any suggestions?

Regard Michael

Status: 
Closed (fixed)

Comments

What error are you getting from phpMyAdmin exactly?

Also, if you login to Virtualmin as the domain owner and go to Edit Databases, click on a database and click the Manage button, do you also get an error?

Hi Jamie, In phpmyadmin, I don't get an error, it just won't let me in. Like the User Name, or Password is wrong. If I access the database through "Virtualmin/Edit Database/Manage" on any one of the databases, it lets me, and I can access the Database.

In the Site its self, if it try's to access the Database I get error "Error cannot access Database"

Michael

What if you install some other PHP app using Virtualmin that accessing a MySQL database, like Drupal - does that have the same problem?

I have 2 other sites the I setup at the same time, and they have no problems accessing there databases, and one of them I just installed a few days ago, its a Forum Program, and it uses a database, and it works fine too. But I have 3 different databases for this one site, and there not very big. From 1K to 1 meg. and they all 3 act like the username or password or both are wrong.

Like I said I have checked the username, and password over and over again, and there set up right.

I also beleave if I delete the Virtual Server, and then recreate it, and the 3 database, with the same username, password it will work. I have done this before a few times. I just would rather figure out what is causing the problem this time.

Michael

Hi Jamie; Well I did it again, I delete the Virtual Server, and recreated it, set up the databases, and imported all the data, using the same username, and password, same database name. Everything is exactly the way I did it the first time, and it all works. Just like every time I had to do it before.

I think it must be a bug in the way it stores the username, or password, or both. Every time it has happened in the past it has always given me the same error message "Unable to access Database" Just changing the Username, and Password doesn't seem to do it. I have to completely remove the Virtual Server, and recreate it just like it was the 1st time, and boom everything works.

So if you figure it out, and can recreate it, and you find the problem, Let me know.

Thanks for the help. You can mark it as temporally fixed.

Best Regards, and have a Safe New Years, and a wonderful, and Blessed 2013.

Michael

Thats odd ... I can't see how that could happen. Unless perhaps a MySQL user already existed with the same name before you created the domain?

Nope different username on all Virtual Servers.

Automatically closed -- issue fixed for 2 weeks with no activity.