WordPress.org

Support

Support » Installation » WordPress config file setup – defining location of database in the first place

WordPress config file setup – defining location of database in the first place

  • 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

Viewing 15 replies - 1 through 15 (of 16 total)
  • 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

    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

    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.

    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.

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

    ?>

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

    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.

    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…

    Here is a screenshot of the bluehost sql setup page:

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

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

    Got it, had to add name_ to the username.

    P

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

    petralyn,
    then you made an identical mistake 🙂

    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.

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

    WAHOOOOOO!! Thanks so much!!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘WordPress config file setup – defining location of database in the first place’ is closed to new replies.