Lunarpages Web Hosting Forum

Web Hosting Guidance and Advice => LPCP Control Panel Help and Tips => Topic started by: bignik on February 16, 2010, 09:12:34 AM

Title: Wordpress and LPCP not connecting to DB
Post by: bignik on February 16, 2010, 09:12:34 AM
In the past I have done what feels like a gubbazillion manual WordPress installs on Lunarpages servers without incident. I was always using CPanel.

I just attempted my first install with LPCP, and it cannot connect to the database.

I read we don't use Localhost with LPCP... but I've entered everything into my WP_config file as it appears on my MySQL Manager page and it won't connect.

The only things that are different from previous CPanel installs are that the hostname is now an IP address (no longer Localhost) and the username has an '@IPaddress' appended onto it.

Should I be change the hostname to something else? Do I keep @IPaddress on the tail end of my username?

Help?!? (And thanks in advance)

Edited to add:: Scroll to bottom... I did get a solution to this problem!
Title: Re: Wordpress and LPCP not connecting to DB
Post by: MrPhil on February 16, 2010, 09:30:31 AM
Who is telling you to use an IP address? I don't use LPCP, but my understanding is that the host name should be the full server name (not "localhost"), something like lpsql01.lunariffic.com and the other fields should be the same as with cPanel.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: bignik on February 16, 2010, 09:51:26 AM
The IP address is the defaut in the 'hostname' field. But it didn't work. Neither did localhost. Neither did lpsql01.lunariffic.com.

What am I missing?
Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 16, 2010, 10:04:19 AM
MrPhil is correct, should be lpsql01.lunariffic.com or lpsql02.lunariffic.com
Title: Re: Wordpress and LPCP not connecting to DB
Post by: bignik on February 16, 2010, 10:49:36 AM
Hmmm... well I'm clearly not as skilled as I thought. I cannot get either one of those to work. Is the DB server down? If not... how can we troubleshoot this? I've checked and double checked and tried various combinations to no avail.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: MrPhil on February 16, 2010, 11:17:03 AM
Can you bring up phpMyAdmin and browse your database? Being able to do so would at least prove that the MySQL server is up and running. If MySQL under LPCP works the same way as on cPanel, you need to create a user and password, and associate that user with a specific database. Have you done that? Have you doublechecked the MySQL server name that you're supposed to be using? I think there are at least three of them (00, 01, and 02).
Title: Re: Wordpress and LPCP not connecting to DB
Post by: bignik on February 16, 2010, 11:42:34 AM
Thanks MrPhil for the suggestions... but no luck.

phpMyAdmin runs and connects to the db with no problem (there is no content in it since WP has been unable to connect to it)
User is created and assigned to the db.
I was assigned 02... and that is not working either.

Does it matter that my WP is not installed on the root? Never has in the past, but then again, I've never had an issue setting up WordPress.

Database name: loginName_databaseName
User name: loginName_DBuserName@lpsql02.lunariffic.com
password: password
Database Host: lpsql02.lunariffic.com
table prefix: wp_

Am I missing dots or slashes or something?
Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 16, 2010, 12:09:31 PM
I would suggest you drop in a help desk ticket (http://support.lunarpages.com), and have them double check to make sure your database is connecting correctly or not. 
Title: Re: Wordpress and LPCP not connecting to DB
Post by: bignik on February 16, 2010, 12:18:27 PM
Thanks Mitch... I did that.

I also have a question now about the following from the critical account info email from LP:

Quote
Database Instructions
MySQL and PostgreSQL
Please note that our MySQL and PostgreSQL databases run on a separate server, so you will need to use the following server name to access those services:

lpsql02.lunariffic.com

This is effective only for the scripts you setup on the server until your domain gets propagated to our ns1.lunariffic.com and ns2.lunariffic.com nameservers.


Can you explain what this means:

Quote
This is effective only for the scripts you setup on the server until your domain gets propagated to our ns1.lunariffic.com and ns2.lunariffic.com nameservers.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 16, 2010, 12:42:52 PM
Let me check real quick, sounds like a typo to me - cause databases shouldn't rely on the nameservers.  

edit - could be they mean that the scripts would not run properly, using databases till the domain name propagation is complete.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: lexhair on February 16, 2010, 12:56:34 PM
Thanks MrPhil for the suggestions... but no luck.

phpMyAdmin runs and connects to the db with no problem (there is no content in it since WP has been unable to connect to it)
User is created and assigned to the db.
I was assigned 02... and that is not working either.

Does it matter that my WP is not installed on the root? Never has in the past, but then again, I've never had an issue setting up WordPress.

Database name: loginName_databaseName
User name: loginName_DBuserName@lpsql02.lunariffic.com
password: password
Database Host: lpsql02.lunariffic.com
table prefix: wp_

Am I missing dots or slashes or something?

See here. (http://www.lunarforums.com/web_hosting_help_and_troubleshooting/unclear_about_what_format_to_use_for_mysql_database_name_and_user-t54328.0.html;msg359387#msg359387)

Your username is loginName_DBuserName. All the stuff after the '@' will screw your connection up.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: MrPhil on February 16, 2010, 02:42:51 PM
Can you explain what this means:

Quote
This is effective only for the scripts you setup on the server until your domain gets propagated to our ns1.lunariffic.com and ns2.lunariffic.com nameservers.

This has been discussed at least once before. Too bad LP can't be bothered to fix the wording, as was promised before.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 17, 2010, 04:49:49 AM
Well, the proverbial hamster wheel is turning on that, just mentioned the feedback again yesterday, so hopefully we can get some more user friendly text in there soon.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: bignik on February 17, 2010, 01:34:10 PM
OK, I'm happy to report that with the help of my support ticket I am now connecting to the database. I thought I'd report the solution here, while it isn't difficult it certainly isn't intuitive so maybe I can help save some else's headache...

The issue I was having was all related to my database username.

When you create your database user in LPCP, type in the name and DO NOT CHANGE the IP address under hostname. Even though you are using lpsql01.lunariffic.com, that is NOT where you enter that information.

After you create your user, the name will show on your MySQLmanager as LoginName_DBusername@IPaddressProvided. That is fine.

When you enter your info into the WP-Config.php file, your username becomes LoginName_DBusername. Do not add on the @ or the IP address.

And your host name (formerly localhost) becomes lpsql02.lunariffic.com (or whatever server name you are given on your Critical Account Info data sheet when signing on).

And there you have it.  :thumb:



Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 18, 2010, 05:02:07 AM
Thanks for sharing bignik!

Update -

I have updated this tutorial to help explain the changes and how to set up a MySQL user correctly.

http://wiki.lunarpages.com/Create_and_Delete_MySQL_Users_in_LPCP

Hope it helps out!  :D
Title: Re: Wordpress and LPCP not connecting to DB
Post by: MrPhil on February 18, 2010, 09:48:45 AM
So @Mitch, why does "Hostname" (containing the IP address) have an editable field, if it shouldn't ever be changed? That was a pretty dumb move by whoever designed the form. If you want to display the IP address but not allow the user to change it, just output it as text. Are there any circumstances where the user should be able to change this field? If not, don't make it changeable! If there are very rare instances, it should be a "readonly" entry field, with a button or switch somewhere else on the page to remove/replace the "readonly" attribute. That will discourage most users from casually changing the IP address.
Title: Re: Wordpress and LPCP not connecting to DB
Post by: Mitch on February 18, 2010, 11:00:14 AM
Well, I don't have any input on the design of how it works or how it looks, however if anybody finds it annoying, has an idea or maybe even a better way I would highly suggest sending in an e-mail to feedback@lunarpages.com so the feedback team can relay the message back to the developers.