How do I allow a user to access a database?

Hi,

I recently created a new domain through virtualmin, with a new user and database which all worked fine. I now want to create a second database and allow the same user to access it, however when I try to access it, it appears the user does not have permission.

I’m trying to install wordpress on the second database, this is the message it gives me during the install script:

We were able to connect to the database server (which means your username and password is okay) but not able to select the ‘mydbname’ database.

Are you sure it exists?
Does the user ‘myuser’ have permission to use the ‘mydbname’ database?

Any advice would be greatly appreciated.

Thanks.

Howdy,

How did you go about creating that second database?

If you’re using Virtualmin Pro, and attempting to install Wordpress using the Install Scripts, what I might suggest is that rather than manually creating a new database, let the Install Script create it for you.

So, if you go into the Install Scripts menu, then choose WordPress and click “Show Install Options” at the bottom – at the next screen, you’ll see the option “Database for WordPress tables”.

It’s default option should be to create a new database – does having it create a DB for you solve the issue you’re seeing?

-Eric