Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Can't connect to local MySQL server through socket...
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
03-12-2014 10:02 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Just trying to get our old PHP/MySQL application working on the new CGI hosting platform.
PHP OK.
MySQL database logged in OK via hosting.plus.net Control Panel / MySQL Manager
Database login credentials correct in PHP database connect code, but getting runtime error:
#Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'#
Checked code for localhost references, none.
URL: http://ccgi.tynemills.plus.com/cars/index.php
Any thoughts?
With thanks, Colin.
PHP OK.
MySQL database logged in OK via hosting.plus.net Control Panel / MySQL Manager
Database login credentials correct in PHP database connect code, but getting runtime error:
#Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'#
Checked code for localhost references, none.
URL: http://ccgi.tynemills.plus.com/cars/index.php
Any thoughts?
With thanks, Colin.
Message 1 of 5
(1,255 Views)
4 REPLIES 4
Re: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
03-12-2014 11:08 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi Colin,
Your SQL login credentials are wrong.
Checking one of your PHP files I can see references to 'humbug' and a pre-migration username/password and database name.
All 'humbug' instances should be replaced with what's in the 'DB Host' column of the MySQL Manager in the Control Panel. The old database table name (username_pn) needs replacing with what's in the 'Available Databases' column.
Your SQL login credentials are wrong.
Checking one of your PHP files I can see references to 'humbug' and a pre-migration username/password and database name.
All 'humbug' instances should be replaced with what's in the 'DB Host' column of the MySQL Manager in the Control Panel. The old database table name (username_pn) needs replacing with what's in the 'Available Databases' column.
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Message 2 of 5
(369 Views)
Re: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
03-12-2014 3:11 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks for that Bob.
I've amended my db connect code as follows, but I'm still getting the error:
<? $res_conn = mysql_connect ("sql5c51a.megasqlservers.eu","tynemills_pn_ccgi_tynemills_plus_com","1a4af0f019fc7c7c");
$res_sel = mysql_select_db ("tynemills_pn");
$datab='tynemills_pn';
$dbusr = 'ccgitynemi966475';
$dbpass = '6****1v';
$dbhost = 'sql5c51a.megasqlservers.eu';
?>
Can you see where this is going wrong.
There was only the one reference to 'humbug' (now amended).
Thanks, Colin.
I've amended my db connect code as follows, but I'm still getting the error:
<? $res_conn = mysql_connect ("sql5c51a.megasqlservers.eu","tynemills_pn_ccgi_tynemills_plus_com","1a4af0f019fc7c7c");
$res_sel = mysql_select_db ("tynemills_pn");
$datab='tynemills_pn';
$dbusr = 'ccgitynemi966475';
$dbpass = '6****1v';
$dbhost = 'sql5c51a.megasqlservers.eu';
?>
Can you see where this is going wrong.
There was only the one reference to 'humbug' (now amended).
Thanks, Colin.
Message 3 of 5
(369 Views)
Re: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
03-12-2014 3:28 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Still various references to the old database name (tynemills_pn), you've the database name instead of the username in the mysql_connect statement and the same statement is using the wrong password.
I've backed up the relevant file with an appropriate file name and created a new one with the correct settings.
You should find it works now?
I've backed up the relevant file with an appropriate file name and created a new one with the correct settings.
You should find it works now?
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Message 4 of 5
(369 Views)
Re: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
03-12-2014 3:33 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks Bob,
All working. 10 out of 10 for service and rapid response.
Colin
All working. 10 out of 10 for service and rapid response.
Colin
Message 5 of 5
(369 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Can't connect to local MySQL server through socket...