Database Connection Strings


I wanted to post this to help others who have run into trouble with the message along the lines of “Cannot Establish Database Connection”.   This can happen for several reasons but usually the fix is fairly easy – you just need to modify a single file in your WordPress or Drupal or other file system according to the instructions below using FTP access.

If you move servers or rename the database or change your password you’ll want to go in and carefully put in the new database name or password.

If you’ve forgotten either of those, you may need to dig in to your control panel to find them.    Ask your web host how to do that part as it depends on many things, but the part below is usually simple and done via FTP to your server.

Source:  Godaddy

Connection strings for website databases:

NOTE:You will have to obtain these files referenced below by FTPing into your hosting account and into the application’s directories. For more information on this, see your application’s manufacturer’s Web site.

WordPress

Edit the wp-config.php file. You will need to update the following line with the name of the new database server.

define(‘DB_HOST’, ‘youroldhostname’);

Joomla

Edit the configuration.php file. You will need to update the following line with the name of the new database server.

var $host = ‘youroldhostname’;

Simple Machine Forum

Edit the Settings.php file. You will need to update the following line with the name of the new database server.

$db_server = ‘youroldhostname’;

DotNetNuke

Edit the web.config file. You will need to update the following line with the name of the new database server.

connectionString=”Server=youroldhostname;Database=DBName;uid=DBUser;pwd=DBPass;”

Drupal

Edit the sites/default/settings.php file. You will need to update the following line with the name of the new database server.

$db_url = ‘mysqli://DBUser:DBPassword@youroldhostname/DBName’;

Zen Cart

Edit the includes/configure.php and admin/includes/configure.php files. You will need to update the following line with the name of the new database server.

define(‘DB_SERVER’, ‘youroldhostname’);

Gallery

Edit the config.php file. You will need to update the following line with the name of the new database server.

$storeConfig[‘hostname’] = ‘youroldhostname’;

Coppermine

Edit the include/config.inc.php file. You will need to update the following line with the name of the new database server.

$CONFIG[‘dbserver’] = ‘youroldhostname’;

OSCommerce

Edit the includes/configure.php and admin/includes/configure.php files. You will need to update the following line with the name of the new database server.

define(‘DB_SERVER’, ‘youroldhostname’);

PhpBB

Edit the config.php file. You will need to update the following line with the name of the new database server.

$dbhost = ‘youroldhostname’;

Vanilla Forum

Edit the conf/database.php file. You will need to update the following line with the name of the new database server.

$Configuration[‘DATABASE_HOST’] = ‘youroldhostname’;

paFileDB

Edit the includes/config.php file. You will need to update the following line with the name of the new database server.

$dbServer = “youroldhostname”;

Noah’s Classifieds

Edit the app/config.php file. You will need to update the following line with the name of the new database server.

$hostName=”youroldhostname”;

OpenX

Edit the var/yoursitename.com.conf.php file. You will need to update the following line with the name of the new database server.

host=”youroldhostname”

BlogEngine.NET

Edit the web.config file. You will need to update the following line with the name of the new database server.

<add name=”BlogEngine” connectionString=”Data Source=youroldhostname;User ID=DBUser;Password=DBPassword;persist security info=False;initial catalog=DBName;” providerName=”System.Data.SqlClient”/>

Geeklog

Edit the db-config.php file. You will need to update the following line with the name of the new database server.

$_DB_host = ‘youroldhostname’;

Lifetype

Edit the config/config.properties.php file. You will need to update the following line with the name of the new database server.

$config[‘db_host’] = ‘youroldhostname’;

reBlog

Edit the config.php file. You will need to update the following line with the name of the new database server.

define(‘REF_DB_HOST’, “youroldhostname”);

Serendipity

Edit the serendipity_config_local.inc.php file. You will need to update the following line with the name of the new database server.

$serendipity[‘dbHost’] = ‘youroldhostname’;

Mantis

Edit the config_inc.php file. You will need to update the following line with the name of the new database server.

$g_hostname = “youroldhostname”;

MediaWiki

Edit the LocalSettings.php and config/LocalSettings.php files. You will need to update the following line with the name of the new database server. $wgDBserver = “youroldhostname”;

WebCalendar

Edit the includes/settings.php file. You will need to update the following line with the name of the new database server.

db_host: youroldhostname

anyInventory

Edit the globals.php file. You will need to update the following line with the name of the new database server.

$db_host = “youroldhostname”;

Mambo

Edit the configuration.php file. You will need to update the following line with the name of the new database server.

$mosConfig_host = ‘youroldhostname’;Community Server

Edit the connectionStrings.config file. You will need to update the following line with the name of the new database server.

<add name=”SiteSqlServer” connectionString=”server=youroldservername;uid=DBUser;pwd=’DBPassword’;database=DBName”/>

MODx

Edit the includes/config.inc.php file. You will need to update the following line with the name of the new database server.

$database_server = ‘youroldhostname’;

Moodle

Edit the config.php file. You will need to update the following line with the name of the new database server.

$CFG->dbhost = ‘youroldhostname’;

Nucleus

Edit the config.php file. You will need to update the following line with the name of the new database server.

$MYSQL_HOST = ‘youroldhostname’;

PostNuke

Edit the config.php file. You will need to update the following line with the name of the new database server.

$pnconfig[‘dbhost’] = ‘youroldhostname’;

SilverStripe

Edit the tutorial/_config.php file. You will need to update the following line with the name of the new database server.

“server” => “youroldhostname”,

Xoops

Edit the mainfile.php file. You will need to update the following line with the name of the new database server.

define( ‘XOOPS_DB_HOST’, ‘youroldhostname’ );

Pinnacle Cart

Edit the content/engine/engine_config.php file. You will need to update the following line with the name of the new database server.

define(‘DB_HOST’, ‘youroldhostname’);

BidWare

Edit the configuration/configure.inc.php file. You will need to update the following line with the name of the new database server.

$bidwareTsohbD = ‘youroldhostname’;

Elgg

Edit the engine/settings.php file. You will need to update the following line with the name of the new database server.

$CONFIG->dbhost = ‘youroldhostname’;

4Images

Edit the config.php file. You will need to update the following line with the name of the new database server.

$db_host = “youroldhostname”;

YetAnotherForum

Edit the yafnet.config file. You will need to update the following line with the name of the new database server.

<connstr>user id=DBUser;pwd=DBPassword;data source=youroldhostname;initial catalog=DBName;timeout=90</connstr>Brim

Edit the framework/configuration/databaseConfiguration.php file. You will need to update the following line with the name of the new database server.

$host = ‘youroldhostname’;

dotProject

Edit the includes/config.php file. You will need to update the following line with the name of the new database server.

$dPconfig[‘dbhost’] = ‘youroldhostname’;

OpenDB

Edit the include/local.config.php file. You will need to update the following line with the name of the new database server.

‘host’=>’youroldhostname’, //OpenDb database host

OrangeHRM

Edit the lib/confs/Conf.php file. You will need to update the following line with the name of the new database server.

$this->dbhost = ‘youroldhostname’;

phpCollab

Edit the includes/settings.php file. You will need to update the following line with the name of the new database server.

define(‘MYSERVER’, ‘youroldhostname’);

PHProjekt

Edit the config.inc.php file. You will need to update the following line with the name of the new database server.

define(‘PHPR_DB_HOST’, ‘youroldhostname’);

Aardvark Topsites

Edit the settings_sql.php file. You will need to update the following line with the name of the new database server.

$CONF[‘sql_host’] = ‘youroldhostname’;

Advanced Guestbook

Edit the admin/config.inc.php file. You will need to update the following line with the name of the new database server.

$GB_DB[“host”] = “youroldhostname”;

Advanced Poll

Edit the db/include/config.inc.php file. You will need to update the following line with the name of the new database server.

$POLLDB[“host”] = “youroldhostname”;

PHCDownload

Edit the include/config.ini.php file. You will need to update the following line with the name of the new database server.

$config[‘db_server’] = “youroldservername”;

phpMyFAQ

Edit the inc/data.php file. You will need to update the following line with the name of the new database server.

$DB[“server”] = ‘youroldhostname’;

phpmyvisites

Edit the config/config.php file. You will need to update the following line with the name of the new database server.

‘db_host’ => ‘youroldhostname’,

PHPOpenChat

Edit the config.inc.php file. You will need to update the following line with the name of the new database server.

define(‘DATABASE_HOST’, ‘youroldhostname’);

MediaWiki

Edit the LocalSettings.php file. You will need to update the following line with the name of the new database server.

$wgDBserver = “‘youroldhostname'”;

 

WordPress Publishing Problems with Flickr or other programs?


Another reminder (because I’ve needed this many times) that you must enable WordPresses “Remote Publishing” protocols if you want to blog photos directly from Flickr  (a fantastic feature – I wish more people could do this but it remains a little tricky to set up both at Flickr and at WP unless you know this is needed (defaults have these boxes UNchecked).   I think you only need the XML-RPC after correct configuration at Flickr, but do both so you have more ways to publish to your WP blog:

Remote Publishing

To post to WordPress from a desktop blogging client or remote website that uses the Atom Publishing Protocol or one of the XML-RPC publishing interfaces you must enable them below.

Atom Publishing Protocol
Atom Publishing Protocol

XML-RPC
XML-RPC

Dear WordPress – Now that you own Intense Debate, please get Intense Debate Comments going at WordPress hosted blogs.


Problem:  Cannot install Intense Debate at WordPress hosted blogs

The internet is a funny place, usually interesting, always provocative, and often frustrating.     In typical internet fashion after learning about how nice it would be to have the  “Intense Debate” comment system here to manage my comments more effectively and allow comment folks to get more out of the blog I spend a half hour learning that it can’t be installed here because I’m hosted at WordPress.

This is a bit odd since (in the typical topsy turvy ironic online world) WordPress actually *owns* IntenseDebate.   They bought it last fall so I can hope they’ll provide support for it soon.    I’m always reluctant to nag the excellent folks at WordPress because they don’t make much if any money from the blogging portions of their massive online programs (they do pretty well with Akismet anti-spamming software and they have one of the world’s largest and in my opinion extremely valuable online footprints).

However I do want to note this for others and hopefully save them the agony of trying to figure out how to install IntenseDebate at a WordPress hosted blog, which as far as I can tell is currently impossible because it’s only available via plugin and plugins are not allowed at WordPress hosted blogs aka WP hosted blog.

Note that you can easily install the IntenseDebate plugin via instructions at IntenseDebate if you have a WordPress.org setup, which is using WordPress Content management software at other sites.    e.g.  Our technology news blog Technology Report is such an external WordPress setup via Godaddy hosting,  so I may try to set this up over there, but unfortunately Joe Duck  is where all the comment action tends to be so this is where we need IntenseDebate!

C’mon Matt Mullenweg, can’t we have an intense debate widget for this  or something?

Who ARE these WordPress Guys? Bravo … again.


WordPress is one of those amazing Web 2.0 companies that always impresses you with innovation and quality.

Here, they have created a way to better index WordPress blog content using Google sitemaps.  WordPres was was already the best CMS system in terms of facilitatating proper search rankings through categories, tagging, and general structure.    Ironically WordPress is better than Google’s own Blogger.com – ie I think it’s fair to say that an identical blog written to the two CMS would rank better in the WordPress version because it is far more robust in terms of crosslinking, creating categories, and with the sitemap feature even pushing out content descriptions to Google.      To Google’s credit they do not appear to elevate blogger content above others – in fact I think the algorithm accurately notes that bloggers blogs have far more spam than WordPress.

Of course one of the best aspects of WordPress is that Matt and his merry band of WordPressers don’t charge a dime for all their great WP work.   They make enough off of spam blocking “Akismet” which is sold to big companies for enterprise network use, and pick up a few bucks from various add-on features such as domain names and CMS styling at WordPress.     This is a perfect example of how innovative entrepreneurship, global scale technology, profit and non-profit can all mix comfortably in systems that work well for every participant.

WordPress dudes, keep up the amazing work!

Free Google blog at your own website? Priceless.


Google has a great feature where you can add a free blogger blog to your website.  I use that for some other blogs though JoeDuck is hosted at WordPress, which offers more powerful content management features than blogger blogs.

Here are the directions for a free blogger blog.  This is for domains hosted at Godaddy but similar will work at most registrars except for Verio where you’ll need to use the IP and not ghs.google.com 

Setting up a free blog that will be hosted at blog.example.com involves TWO basic steps.   First setting up the blog at blogger.com, then configuring the DNS at Godaddy to direct people to the blog as if it was at your website.   The existing pages at your *website* will be unaffected by these change though be sure you have pages backed up for good measure.  

1)  Set up account or log in to existing Google account at blogger.com
2)  Create new blog with blog address (URL) “example.blogspot.com”
3) Under “advanced settings” choose “custom domain” and enter in box:     blog.example.net

1) Next, head to your Godaddy account and “manage domains”.  Select   example.net
2) Click on “Total DNS Control….”
3) Create create CNAME record
4) Enter Alias name:    blog.example.net
5) Points to Host name:     ghs.google.com 

The blogger.com blog will have a small default blog toolbar at the top of the blog that can be deleted as well.  As far as I know Google is OK with this modification to delete the obnoxious toolbar though I’m not positive it’s OK.    I don’t have time to look up that little coding hack now but will try to post later …

Will work for free WIFI: The New Journalism?


Scott Karp has a nice post today about the intersection of journalism and blogging.    I’m glad he notes the weakness of the argument that bloggers cannot be journalists.   Suggesting mainstream journalism is on firm and high ground is especially absurd in this world where yellow journalism generally trumps quality, superficial treatments cripple even the few fine writers at major newspapers, and Fox and CNN TV news parade AnchorModels chosen primarily for looks (women) or bombastic nonsense (men) or both (Anne Coulter).

I’d suggest that a key challenge to conventional journalism is not so much one of quality writing as it is *scalability*. Bloggers work for nothing or peanuts, and there are many more coming in the wings.  Most blogs will continue to suck, but some will be great and this number will increase as more writers get comfortable with the medium.

It will be increasingly difficult for publishers – even cutting edge, well funded ones like Nick at Gawker who is hiring a “journalist” –  to justify paying much for content. I don’t think Gawker’s decision to hire a legacy media journalist reflects a new trend, rather it reflects a fairly atypical reversion to old trends during this transition period.   

Contrast Gawker’s success with the demise of Blognation, which was not even paying people.  Would they have succeeded with a bunch of “real” journalists? No, of course not.    Good writing is cheap and getting cheaper.   That’s not necessarily a good thing, but it’s certainly an inevitable thing.

Blogger and OpenID


Reshma Kumar over at Webguild is reporting on Google’s upcoming launch of blogger based blog commenting that will support OpenID.   This is a great development and kudos to Google for again doing the right thing, which is making it easy for people to comment without having to do a separate login.   Also, along with Open Social, this approach is coming closer to the ideal online environment where you log in ONCE, and then interact in a robust way with all online environments and other onliners.   The analogy we should all be using is that of a massive party where everybody has a searchable name tag that contains all the info they care to share including pictures, writings, and resumes.    The complication is obvious here – some people will want to keep some things from some people.    I’m not sure how to manage that part since turning the info “on and off” does not work well in our cached and oft-downloaded online info environments.

Reshma notes:
 Users of OpenID-enabled services such as LiveJournal and WordPress can comment on a blog using their accounts from those sites rather than with a Blogger/Google account.

 This may not sound like much, but it will increase the ease of commenting on other people’s blogs.   I’m concerned by how blog commenting is becoming a dying art.   This is due to part to spam comments and in part to blogger selfishness where they don’t want to add to other’s blogs for a variety of SEO or ego reasons.      Ideally I’d like to see every person with their own blog, and then an auto-trackback feature so the conversations would span multiple blogs and instead of comments you’d just have dozens of interconnected blog posts on a topic.   However many people don’t want to have a blog but do want to participate.   This will help with that.

WordPress Rocks!


I’m a huge fan of WordPress, which is used throughout the world to spread the word about topics as diverse as you can imagine.   WordPress is not only simple to use, but it’s a very robust content managment solution.   It is also free in a great testament to the online virtuousness of WordPress and it’s 18 employees including founder Matt Mullenweg, who the ripe old age of 23 has already become a key figure in the blogging world.

Here’s an interview with Matt from the Blog conference now on in Las Vegas.   Hey -why didn’t I go to this?

I had the pleasure of meeting Matt at a Mashup Camp (or was it Startup Camp?) in Silicon Valley last year.    He’s a brilliant but unassuming fellow and a great example of how insight and innovation can lead to a magnificent achievement.