Did you mean to connect to: mysql://localhost:3306?
Port 3306 is for database connections, not web browsers. Use your MySQL client or application to connect.
sudo systemctl status mysql (Linux)brew services list | grep mysql (Mac)net start mysql (Windows)
mysql -u root -pmysql -h localhost -P 3306 -u username -p
lsof -i :3306 (Mac/Linux)netstat -ano | findstr :3306 (Windows)
sudo systemctl start mysql (Linux)brew services start mysql (Mac)net start mysql (Windows)
Port 3306 is the default port for:
This Windows error indicates MySQL service is not running:
net start mysqlmysql --versionAuthentication error when connecting to MySQL:
sudo mysql -u root -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; FLUSH PRIVILEGES;
mysql -u root --auth-socketSELECT user,host FROM mysql.user;CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost'; FLUSH PRIVILEGES;
Common on Linux/Mac when MySQL socket file is missing:
sudo systemctl status mysqlsudo find / -name "*.sock" 2>/dev/null | grep mysqlsudo systemctl start mysqlmysql -h 127.0.0.1 -P 3306 -u root -pAnother process is using MySQL's port:
lsof -i :3306 or netstat -tulpn | grep 3306sudo systemctl stop mysqlsudo kill -9 PID[mysqld] port = 3307
sudo systemctl start mysqlMySQL is blocking connections from your host:
GRANT ALL PRIVILEGES ON *.* TO 'username'@'your_ip' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
[mysqld] bind-address = 0.0.0.0
SELECT user,host FROM mysql.user;