Jump to content

Recommended Posts

I am getting this error when I try and view my CMS.

Warning: mysql_pconnect() [function.mysql-pconnect]: Unknown MySQL server host 'MYSQLHOST' (1) in/home/neatspac/public_html/cms/includes/classes/MySQL.handler.class.php on line 100

The issue is that it is looking for MYSQLHOST and it needs to be LOCALHOST. I just don't know how to change it to look for localhost in the MySQL.handler.class.php file on line 100 below:

if($this->connection = ($bPersistant ? mysql_pconnect($sHost, $sUser, $sPassword) : mysql_connect($sHost, $sUser, $sPassword))) {
		$this->setConnected(TRUE);

How do I make it "localhost" in this snippet of code?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/203108-change-to-localhost/
Share on other sites

Thanks for the reply. I will have to try and find out where $sHost is defined (then I could just change it to localhost) correct??

 

Also, what is that snippet of code you put in your last post? I don't know what I should do with that. I am a SQL novice (obviously).

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064213
Share on other sites

Could I not just replace $sHOST with localhost like this:

 

if($this->connection = ($bPersistant ? mysql_pconnect(localhost, $sUser, $sPassword) : mysql_connect(localhost, $sUser, $sPassword))) {

        $this->setConnected(TRUE);

 

Yeah, but that would only fix it for that file.  If '$bHost' is used anywhere else it won't work.

 

I just had to locate the config.php file and change the host to "localhost" in there. Problem solved.

 

Nice, I figured there was some sort of configuration file being included.

Link to comment
https://forums.phpfreaks.com/topic/203108-change-to-localhost/#findComment-1064263
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.