Error 10061 / Port 3306 appears to be closed on my Ubuntu server

The problem was that the server was listening internally only. Removing the line bind-address from /etc/mysql/my.cnf solved the issue. In Ubuntu 16 and MYSQL 5.7, the configuration file was in:


Error 1045(28000) / Error connecting in console (local) / Access denied for user ‘root@localhost’ (using password: no )

if you want to make easier to access your mysql create .my.cnf in /root/ and put in it

user = root
password = mysqlrootpassword
user = root
password = mysqlrootpassword
user = root
password = mysqlrootpassword

Fail to connect remotely from MYSQL Workbentch of the client (ex

$ mysql -u root -p
Enter password:
mysql> use mysql
mysql> GRANT ALL ON *.* to root@'' IDENTIFIED BY 'your-root-password'; 

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

Wrong Server ip in the /etc/mysql/my.conf

  1. Log in as super user or use sudo
  2. Open /etc/mysql/my.cnf using gedit
  3. Find bind-address, and change its value to the database server host machine’s IP address. For me, it was localhost or
  4. Save and close the file
  5. Come back to terminal and execute sudo service mysql start