Can't find SQL database (12 posts)

  1. scribbler
    Posted 12 years ago #

    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.

  2. philor
    Posted 12 years ago #

    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.

  3. scribbler
    Posted 12 years ago #

    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.)

  4. philor
    Posted 12 years ago #

    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 yoursite.com/whatever.php. Sorry, I wasn't quite as clear as I should have been ;)

  5. Strokemouth
    Posted 12 years ago #

    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.

  6. Anonymous
    Posted 12 years ago #

    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.

  7. scribbler
    Posted 12 years ago #

    Er...that preceding post is from me.

  8. philor
    Posted 12 years ago #

    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 :)

  9. scribbler
    Posted 12 years ago #

    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

  10. scribbler
    Posted 12 years ago #

    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");

  11. philor
    Posted 12 years ago #

    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

  12. scribbler
    Posted 12 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.