MyBB Community Forums

Full Version: 2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I am going crazy here... sorry if I sound a touch nutty today.

My forum url: http://articlechase.com/beyondnews

Anyhow I changed server and host, uploaded my backup of my website to the root directory and thought great things are going okay. Then I tried to login into my forum four days ago and got the following error:

2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I cannot figure this out, I have tried to contact the host and after 3 days of waiting they said it is a coding issue and have no knowledge of it. Great I thought... now what???

So I turn to you guys at MyBB as someone around here must know of a solution.

A couple of things I have tried to do:

1. Re-Install a fresh MyBB forum - then drop the files over the top - it still brought up that same error.

2. No fresh install just dropped over the MySQL backed up file and uploaded the forum file to the root directory. The same error code appears.

It seems I am at a loss here unless somebody knows how to solve it with a walk through instruction.

Thanks

Regards.

Got it... hosting issue. Grrrrrrrrrrrrr! Totally p*s@ed off as the host says they cannot fix it.
if the host cannot fix that then you may have to use this trick. however check all responses on that thread
(2013-03-25, 01:18 PM).m. Wrote: [ -> ]if the host cannot fix that then you may have to use this trick. however check all responses on that thread

Thanks a lot, I have the fix but that is handy to know.

Just for those who need to know the answer to this problem I have the fix right here.

You need to go to the folder that your forum is uploaded to:

You need to then go to the 'inc' file and locate the config.php

Open the config.php file and make sure that you correct all the fields to point to the right places eg Hostname, your database name, your database user name, and the database password. Example below:

$config['database']['type'] = 'mysql';
$config['database']['database'] = 'DATABASE NAME';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'HOSTNAME';
$config['database']['username'] = 'DATABASE USERNAME';
$config['database']['password'] = 'DATABASE PASSWORD';

You should be good to go... YAY! I am so happy I have that issue all figured out and learned something new today.