WordPress.org

Ready to get started?Download WordPress

Forums

WordPress config file setup - defining location of database in the first place (17 posts)

  1. sammymocha
    Member
    Posted 6 years ago #

    I've created an (empty) sql database via my host's control panel. I can see the contents of the WordPress folder on the sever, but don't see any databases. Does anyone know how to create a new database for WordPress, and which directory does it go in? Thanks very much! Anne

  2. moshu
    Member
    Posted 6 years ago #

    It doesn't go to any directory. Databases are NOT in directories. They are... err, in the database.
    When you created it, it should have told you what the database (mysql) server is = that's the location to put in the DB_HOST line.
    More details:
    http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php

  3. sammymocha
    Member
    Posted 6 years ago #

    I'm used to seeing databases as files like .dbf or .mdb which reside in some directory somewhere and I can type in the path to. You know, with tables you can query. So this concept is new to me. How do you define it then?

    My host, BlueHost, allows me to create a sql database and name it and add users, but does not give the sql server name. Any idea where to get that? I am sure this is super easy and I'm not getting it! Thanks for your help!

    I have a screen shot of what I'm seeing with the database setup. Can I attach it to this post? Thanks again..

    Anne

  4. moshu
    Member
    Posted 6 years ago #

    It is not really relevant what kind of (MS) databases you used to see...

    Now you have to learn the MySQL database - that's what works for WP. Looking around in your hosts support forum you could find after 2 minutes that the DB_HOST on their server is "localhost".
    The rest you have:
    DB name, DB user, and pw for it.

    Now read the resources I linked above.

  5. VeraBass
    Member
    Posted 6 years ago #

    Database files are pieces of data extracted from the database. A database isn't information, it is a structure for storing information.
    If you want to 'see' your database, submit sql queries, etc., find the icon in the database section of the BlueHost control panel that is called PHPMyAdmin.

    As Moshu wisely indicates, though, you don't need to see your database to install and operate WP.

  6. sammymocha
    Member
    Posted 6 years ago #

    Yup, I printed out and read all topics. You are correct, this should be a piece of cake. All I'm doing is changing the config file and running install. So.. it will find the database by the name in the config file alone, doesn't need any path.

    Ran install.php and same error - can't find DB. Have checked config file over and over and it appears fine. This must be something really dumb since there are only 3 pieces of text to change in config. Below is config file. I tried my DB_NAME as "truckeed_blog" as well as "blog". Tried DB_USER as "truckeed_anne" as well as "anne". Config and install files are in right places.

    Any more steps I can take to troubleshoot? Thanks again!!

    <?php

    // ** MySQL settings ** //

    define('DB_NAME', 'truckeed_blog'); // The name of the database

    define('DB_USER', 'truckeed_anne'); // Your MySQL username

    define('sam123', 'yourpasswordhere'); // ...and password

    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    define('DB_CHARSET', 'utf8');

    define('DB_COLLATE', '');

    // You can have multiple installations in one database if you give each a unique prefix

    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the

    // chosen language must be installed to wp-content/languages.

    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'

    // to enable German language support.

    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    define('ABSPATH', dirname(__FILE__).'/');

    require_once(ABSPATH.'wp-settings.php');

    ?>

  7. moshu
    Member
    Posted 6 years ago #

    What is exactly the error message you get? (there are more than one...)

  8. sammymocha
    Member
    Posted 6 years ago #

    It's not finding the database name. I have tried truckeed_blog, blog, anne_blog, no avail. Here is error:

    WordPress

    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 blog database.

    * Are you sure it exists?
    * On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?

    If you don't know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

  9. moshu
    Member
    Posted 6 years ago #

    As you can see, everything is fine - except the name of the database you have created. So, now you have to worry only about that one piece :)

    Earlier you wrote:
    I have a screen shot of what I'm seeing with the database setup. Can I attach it to this post?
    Well, you can not display it here but you can upload to your site or to an image storage site and give us the URL...

  10. sammymocha
    Member
    Posted 6 years ago #

    Here is a screenshot of the bluehost sql setup page:

    http://truckeedonnerphotos.com/Picture%203.png

  11. petralyn
    Member
    Posted 6 years ago #

    I would to add, I,too, am having the identical problem with the identical error message.

  12. petralyn
    Member
    Posted 6 years ago #

    Got it, had to add name_ to the username.

    P

  13. moshu
    Member
    Posted 6 years ago #

    sammymocha,
    Well, according to that pic it should be truckeed_blog

    petralyn,
    then you made an identical mistake :)

  14. sammymocha
    Member
    Posted 6 years ago #

    truckeed_blog not working either - here is new error:

    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 truckeed_blog database.

    * Are you sure it exists?
    * On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?

    If you don't know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

  15. moshu
    Member
    Posted 6 years ago #

    Hmmm...
    Did you ever click on that SUBMIT button in the section where it says: Add User to Database???

  16. sammymocha
    Member
    Posted 6 years ago #

    WAHOOOOOO!! Thanks so much!!

  17. moshu
    Member
    Posted 6 years ago #

    LOL, I should have thought about it earlier... during my very fist WP install I was struggling with that missing "click" a whole night :)

Topic Closed

This topic has been closed to new replies.

About this Topic