• HI, I am trying to install WP on a Mac OS X Mavericks local machine with the following data config:

    • No db username and pw – therefore I leave the corresponding fields blank.
    • Host: “localhost”.
    • Database name: “drak”.

    This is the error I get:

    Can’t select database
    We were able to connect to the database server (which means your username and password is okay) but not able to select the drak database.
    
    Are you sure it exists?
    Does the user have permission to use the drak database?
    On some systems the name of your database is prefixed with your username, so it would be like username_drak. Could that be the problem?
Viewing 5 replies - 1 through 5 (of 5 total)
  • mySQL requires a username and password. There has to be a user set up and allowed access to that database otherwise the database server will block any requests. Connecting to the server is a different matter. You can set that up… but even in a situation like this it’s not quite so secure and I wouldn’t recommend it. Just set up a user and set the permissions to allow full access to that database.

    Thread Starter mad_griffith

    (@niccolomineo)

    I only need it for local theme development. Not as an in-production environment.

    As written in the error, pw and username seem fine. I really don’t understand what is going on since the db with that name exists.

    As I said before the MySQL database can only be accessed by MySQL users that have the correct permissions set up. Without a user there’s no permissions, and when there’s no permissions there’s no access. Connecting to a database is a completely different thing than connecting to the server, which can be done without a username if the servers settings allow it.

    Thread Starter mad_griffith

    (@niccolomineo)

    Then part of the error where it say “We were able to connect to the database server (which means your username and password is okay)” is not true?

    Anyway, I created the password (username: root) and now it works. ??

    Thanks for the advice, catacaustic.

    It is true that you could connect to the server without a username/password. But that’s connecting to the server, not connecting to the database. That’s two very different things, and that’s something that a lot of people don’t quite get (it took me a while to get my head around it when I first saw this sort of thing myself).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘"Can't select database", but db is there’ is closed to new replies.