V10 installation mysql error

i’m getting this error when i’m trying to install v10

“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”, “stderr_lines”: [“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”]

Dear @Bassam_Mamdouh , Kindly check this thread and the comments.

1 Like

hello @fnrfarid
yes i know and i already reply on that topic but i wanted to report it here one more time so maybe the frappe team can fix this error at the bench it self to avoid this extra step

This"extra step" doesn’t work.

After the installation generated the error, I followed those instructions to comment out the mysgl.sock line and restart the database. The server still would not start. Could not even get a login screen.

Did I miss something? Is it possible that something else never got around to finishing during the install process once the database choked?


I had this issue too on a fresh install I did, thankfully I had an image where I restored to get back to a fresh install environment, but I realized this error started happening about a week and a bit ago.

Well, I guess, they already are pretty much aware of this issue. We all hoping they will make a permanent solution soon. :slight_smile:

@rmehta can you help with this issue important please ?

hello guys @fnrfarid @bkm @Nate_Riches @shrirangbhalerao2 @sanju75 i just solved the problem right now :smile: but i will apply a pull request to the main bench repo to apply the solution :smiley:
@rmehta i wish if you accept my pull request to solve this serious problem, its under pull request " fix-mysql-error " by elba7r.

Best Regards

The mysql configuration file looks for the socket and the pid in /var/run/mysqld directory, however MariaDB puts it in /var/lib/mysql directory.

You’ll need to create symbolic links to the socket and pid files in the required directory

Executing this should solve the problem:

$ sudo ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock
$ sudo ln -s /var/lib/mysql/mysql.pid /var/run/mysqld/mysqld.pid

A PR has been sent to bench. Will fix the issue in the easy install.

It was an incorrect way to go about it.
Create a file named z-erpnext.cnf in /etc/mysql/conf.d/, and put the following in it

pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock

Please refer erpnext_admin_guide | ERPNext Administrators Guide

Okay, first tried to install using easy scripts, then it gives error while creating new site. Then I ran

and ran command the install command again, “sudo python install.py --production --user frappe” gives error as earlier. :frowning:

@fnrfarid Hey I edited my previous post