Support » Installing WordPress » Can’t find SQL database

  • I try to run install, and get the error message: “We’re having a little trouble selecting the proper database for WordPress.”
    Yes, according to the informatin on my site management page, the DB exists, with the name I’ve put in my config.php file.
    I’m baffled, and insufficiently versed in MySQL etc. to find my own way out.

Viewing 11 replies - 1 through 11 (of 11 total)
  • If you’ve gotten that far, things aren’t going too badly, it’s connected fine and just can’t select the database. Are you sure that the user you’ve given to WordPress has rights for that database? You can see what databases your user can see from PHP (and what names the server uses for them) by just saving and opening in a browser:
    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    $db_list = mysql_list_dbs($link);
    while ($row = mysql_fetch_object($db_list)) {
    echo $row->Database . "<br>";

    with the working values you’ve got for the dbhost, user, and password replacing the values in that first line.

    Sorry to be the slow kid in class, but I’m still unclear about these instructions. (I know almost nothing about PHP and SQL.) I save and open…what? (Thanks for trying to help, I very much appreciate it.)

    Save that in a file named whatever.php, and upload it to your server, and then look at it in a browser by going to Sorry, I wasn’t quite as clear as I should have been 😉

    One thing you may want to check:
    A lot of times, if you use something like the ‘Manage MySQL’ link found in most webpages’ cPanel, you need to explicitly add a user to be given access to the databases.

    Ack, this is so frustrating?
    I go to my cpanel, which states that I have a SQL database: dalekeig_wordpress.
    It also states that there’s a user for that database: dalekeig_dale.
    I try to run install-config.php, input these settings plus my password, and get the same response: Are you sure it exists?
    I have found that screaming at the machine…Yes it exists, damn it!! has not had an appreciable effect. Though I feel a little bit better.
    I’m not giving up only because I’m stubborn as a government mule with this stuff. But I’m not having fun.

    Er…that preceding post is from me.

    I don’t use cpanel, but a little googling makes it look like you not only have to create the database, and create the user, you then need to stick the two together, er, grant the user permissions on the database. Is it saying that the user has permission to go hog wild on dalekeig_wordpress, or just that both exist?
    And yes, the blank page would say that as far as MySQL knows, there aren’t any databases that your user is allowed to see.
    I’ve found the same thing about screaming at people who don’t grasp how to behave at a four-way stop: they don’t learn anything, but I feel better 🙂

    I must be getting closer. I followed the instructions on sticking the tw–DB and user–together. Now when I run “whatever.php” I get a response: dalekeig_wordpress.
    But, I retry install-config.php and I get the following:
    Warning: Invalid argument supplied for foreach() in /home/dalekeig/public_html/wordpress/wp-admin/install-config.php on line 121
    Warning: fclose(): supplied argument is not a valid stream resource in /home/dalekeig/public_html/wordpress/wp-admin/install-config.php on line 142
    Warning: chmod(): No such file or directory in /home/dalekeig/public_html/wordpress/wp-admin/install-config.php on line 143
    Still puzzled in Baltimore

    Oh, and on my cpanel, there is this:
    Connection Strings
    $dbh = DBI->connect(“DBI:mysql:dalekeig_wordpress:localhost”,”dalekeig_dale”,”<PASSWORD HERE>”);
    $dbh=mysql_connect (“localhost”, “dalekeig_dale”, “<PASSWORD HERE>”) or die (‘I cannot connect to the database because: ‘ . mysql_error());
    mysql_select_db (“dalekeig_wordpress”);

    Closer? You’re almost there. You’ve probably got a copy of 1.0.1-miles, right? install-config.php was, er, not quite as perfect as it could be. Easiest thing to do is just skip over it by editing wp-config.php by hand: save a copy of wp-config.sample.php as wp-config.php, and plug in the data that cpanel conveniently provided in the four lines at the top that start “define”, then upload that to your WordPress directory (the one with stuff like wp-atom.php and wp-comments.php, not wp-admin), and jump ahead to wp-admin/install.php

    Woo-hoo!! It worked! Now I can think about converting my MT blog and causing myself some real problems. Thanks to all, especially Phil.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can’t find SQL database’ is closed to new replies.