Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
snippet in sql

can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'

user8252

# Start your mysql server
/etc/init.d/mysql start

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

user9948

service mysql start

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

user3777

sudo apt-get install mysql-server

how to connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

user6269

#/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) Ask

user1445

##	ERROR 2002 (HY000): 
##	Can't connect to local MySQL server through socket 

#### Follow below steps and you good to go... ####
sudo dpkg-reconfigure mysql-server-{version_number}
##version_number should be mysql version number installed
## Now try login in mysql shell
sudo mysql -u root -p

error 2002 (hy000): can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)

user450

mysql -h 127.0.0.1 -P 3306 -u root -p <database>