MySQL Error 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) code example
Example 1: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
ps aux | grep mysql
sudo /etc/init.d/mysql start
sudo apt-get install mysql-server
Example 2: error 2003 (hy000) windows 10
1-Click on the Windows 7 start button and type taskmgr in the search bar
2-Right click on the taskmgr program icon and select Run as administrator
3-In the Task Manager window, go to the Services tab
4-Right click on the MySQL service and click Start Service
Example 3: docker ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)
% docker run --rm -d -e MYSQL_ROOT_PASSWORD=pass -p 3325:3306 --name mysql_test mysql:5.7
% mysql -uroot -ppass -h127.0.0.1 -P3325