• I am getting the following error:

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

    Are you sure it exists?
    Does the user dbuser have permission to use the ‘cemeteries’ database?
    On some systems the name of your database is prefixed with your username, so it would be like username_‘dbname’. Could that be the problem?

    I have read many messages on these boards about this. I have watch a couple of youtube videos.

    I am sure that the database exists. I can connect to it using the same database name, username and password in NaviCat, PHPMyAdmin, and SequelPro. If all three of these programs can connect to the MySQL database and create tables, why can’t the WordPress install script?

    I have tried many different versions of the wp-config parameters. I’ve appended the database name with the username, tried “localhost” for the server name, etc.

    Clearly the the following parameters are correct;

    DB_USER
    DB_PASSWORD
    DB_HOST

    Because the error message says the WordPress installer can connect. The only thing that can be wrong are the

    DB_NAME

    But, I’m telling ya, the three other programs (NaviCat, MyPHPAdmin, and SequelPro) all connect with the database name I’m using.

    The other possibility is that the permissions for my user are lacking. Again, those other programs connect and can manipulate the database using the login I am providing to wp-config.

    I’ve installed WordPress on two different local machines, and I’ve been using MySQL databases with my hosting company (Intermedia) for a long time. I don’t understand where my mistake is.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi
    I am getting a similar issue but it is with connecting to custom tables in the WP database. Where i have been running MySql query statements, these no longer work as WP has changed to MySqli where php version is equal to or higher than 5.5

    My issue is It will not run the query without the db connection name and I have no idea what WP call the connection ??

    patdundee
    It is both a breach of the forum rules and etiquette, and also detrimental to resolving your issue to impose your problem into an existing thread, please start your own thread, there is a limitless supply of threads.

    Sedris
    This is very strange.

    Just to be absolutely sure that your wp-config.php is good, could you open wp-config.php in your editer, delete the database name including the quote marks, retype the single quote marks, then access the database via (NaviCat, MyPHPAdmin, or SequelPro), and COPY/PASTE the database name between the quote marks, save and upload the file.

    If this does not work, then it may be that the user does not have enough permissions, I know you can create tables, but there are lots more permissions that that. So in this case, create a NEW USER, NEW PASSWORD, NEW Database, assign user ALL privileges on database. In my hosting (cPanel) this is not done with phpmyadmin, but rather with “MySQL Databases”, and then COPY/PASTE all the details into your wp-config.php file and upload it.

    If this doesn’t work then talk to your hosting support.

    Thread Starter Sedris

    (@sedris)

    Ross,

    Thank you so much for your advice. Your instructions led me to think, maybe I gummed up the syntax of the wp-config file in all of my thrashing. So here is what I did:

    I downloaded wordpress a second time so that I could have a completely clean version of the wp-config-sample file.

    I am on a mac, and I was using textedit. For mac users, I can’t tell you how many times textedit has done me wrong. I think it was the culprit here. I downloaded TextWrangler from bare bones software and used that to edit the wp-config file. I could have, and should have, used Dreamweaver the first time around.

    I copy and pasted the name database from my NaviCat connection into the config file.

    When I ran the install script after uploading my clean wp-config everything worked. IT MAY HAVE BEEN A PROBLEM WITH A CURLY QUOTE.

    For Intermedia users who may have a similar problem, I checked with Intermedia and the “owner” of a database has the maximum set of permissions.

    Thank you, Ross. Your advice was a big help.

    Glad to hear you got it sorted. However, this is yet another example of how things can go pear shaped when manually creating the config file as suggested in the installer dialog.

    In my literally 100s of installations on numerous remote and local servers, I have yet to encounter an issue when using the ‘Create a Configuration File’ option ??

    Thread Starter Sedris

    (@sedris)

    You’ve sold me. I’m not sure why I choose to do it manually. From here on out I use the ‘Create a Configuration File’ option.

    I am on a mac, and I was using textedit.

    That’s exactly what the problem was. TextEdit is good for doing WYSIWYG editing, but it does munge quotes (single and double) into the “special” opening and closing quotes, and these are bad for programmers.

    There’s no problem doing it manually (I do but I’m overly cautious about things like that and I do have a few custom things that I add as well), but you need to use a real text editor or IDE.

    Thread Starter Sedris

    (@sedris)

    These word press boards are nice! I thought this kind of helpful civility had gone the way of the dodo on the Internets!

    $myrows = $wpdb->get_results( “INSERT INTO Subscribe(name, username, password, email_id)VALUES(‘$name’, ‘$uname’, ‘$pswd’, ‘$email’)” );

    Here is Link Where You Got Real Result. Click Here

    [Promotion moderated]

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can't Select Database’ is closed to new replies.