Page 1 of 1

How does WordPress know which database on my server to use?

Posted: Sun Aug 10, 2014 3:53 pm
by dwhittaker
I'm a new user to WordPress. I just installed a MySQL database on my server space.
Host: dwhittaker-b.db.sonic.net

I installed WordPress today and am going through all the settings to create a blog for a client whose web site I created. The test site is located at http://www.neptunemedia.net/BronTaylor. WordPress is installed at http://www.neptunemedia.net/BronTaylor/wordpress.

What I can't figure out after investigating this for over 2 hours today is how does WordPress know which database to use? How does it know to point to dwhittaker-b.db.sonic.net? Before I start creating the blog I need to make sure everything is pointing in the right direction.

Thanks! :ugeek:


***** UPDATE TO MY QUESTION *****

I finally found some information on the WordPress forums. Apparently I'm supposed to edit the wp-config.php file. The detailed explanation of how to do this in located here http://codex.wordpress.org/Editing_wp-c ... e_Settings. I assume that means editing it with a text editor.

I'm very comfortable editing text files. I know Javascript and have taken a C++ course so I don't have a problem doing this. But if this is in fact the only way to set WordPress to point to the correct database, why isn't this an automated step when installing WordPress on my server? I'm sure I'm not the only one with this question. Perhaps I'm missing something?

Also, I notice that someone in this forum suggested you install cPanel for WordPress users. This is highly recommended by WordPress and automates all this database stuff. cPanel is also referred to a lot in Visual Quickstarts Word Press book. You might want to look into intalling cPanel.

Thanks guys!

Re: How does WordPress know which database on my server to u

Posted: Mon Aug 11, 2014 9:52 am
by thulsa_doom
If you use our one-click installer we set up the wp-config.php automatically. Otherwise you're stuck filling out the form Wordpress presents you with when you first attempt to access its admin page, which is the default "I want to install my own copy of Wordpress somewhere" behavior of that software.

Re: How does WordPress know which database on my server to u

Posted: Wed Aug 13, 2014 1:20 pm
by dwhittaker
Yes I used your "one click" installer for Word Press. I also used added a MySQL database from the menu in Member Tools per instructions from your Tech Support. I had no idea that the WP installation creates it's own database. This was the confusion.

I opened the wp-config.php file and notice that it auto generated all the settings. I'm assuming it's ok to change the name of the DB, User and PW?

These are settings in wp-config.php:

// ** MySQL settings ** //
define('DB_NAME', '88694_oc_1'); // The name of the database
define('DB_USER', '88694_oc_1'); // Your MySQL username
define('DB_PASSWORD', 'c40ad02dba9aca32b3d9b643399a4d2b'); // ...and password
define('DB_HOST', 'b.custsql.sonic.net'); // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('WP_SITEURL', 'http://neptunemedia.net/BronTaylor/wordpress');

Re: How does WordPress know which database on my server to u

Posted: Thu Aug 14, 2014 5:08 pm
by dwhittaker
This question still isn't answered. It seems that no one at Sonic has even read my last post. The only answer I got from anyone at Sonic didn't even address most of the questions I posed in my post. The WordPress and MySQL installations is confusing and any documentation is pretty much non-existent. You have nothing for users to refer to and your support for this feature is abysmal. I've spent hours and hours trying to figure this out with little help from Sonic. This is the fist time in 4 years I've any problems with your support. I'm asking the most basic questions about this procedure and still have no help from you guys. This is totally unacceptable.

Re: How does WordPress know which database on my server to u

Posted: Fri Aug 15, 2014 12:53 pm
by cdkeen
dwhittaker wrote:This question still isn't answered. It seems that no one at Sonic has even read my last post. The only answer I got from anyone at Sonic didn't even address most of the questions I posed in my post. The WordPress and MySQL installations is confusing and any documentation is pretty much non-existent. You have nothing for users to refer to and your support for this feature is abysmal. I've spent hours and hours trying to figure this out with little help from Sonic. This is the fist time in 4 years I've any problems with your support. I'm asking the most basic questions about this procedure and still have no help from you guys. This is totally unacceptable.
I answered your questions in the previous post you made yesterday, but allow me to repost that here:

If you used the once click installer we provide for wordpress you can administer the settings for the database via this url: https://members.sonic.net/databases/ You can change the password for the 3 available users (all,rw,ro), and create new databases if you need.

I would recommend checking out the first link for an understanding of the wordpress password mechanisms (http://eamann.com/tech/wordpress-password-hashing/) and the second for an exhaustive list of how to reset your password in wordpress (http://codex.wordpress.org/Resetting_Your_Password).
>>

To answer your specific question posted here, the database wordpress connects to is defined in the file wp-config.php:
define('DB_NAME', 'actual_database_name');

Our customer support is not equipped to provide the kind of assistance you would get from a web developer so please don't get frustrated if they tell you that kind of assistance is unsupported. If you are unable to find the answer to a question by searching online then feel free to post your query here, and be as specific as possible, and we will try to help you.

Thanks for choosing Sonic.net!