How do I fix too many connections error in MySQL?


  1. Identify the max_connections variable value: mysql –user=”root” –password=”PASSWORD” –execute=’SHOW VARIABLES LIKE “max_connections”;
  2. Use your favorite text editor to change /etc/mysql/my.cnf and set the following values: max_connections = 500.
  3. Restart the MySQL service and to apply the changes.

How do I fix error 1049 in MySQL?

Two options for you :

  1. Remove USE mydatabasename; in your dump, and keep using : mysql -uroot -pmypassword mydatabase
  2. Change your local database name to fit the one in your SQL dump, and use : mysql -uroot -pmypassword mydatabasename

How do I fix MySQL connection refused?


  1. Open /etc/mysql/my.cnf in a text editor.
  2. Change the bind-address = 192.X.X.X to bind-address = and save.
  3. Restart MySQL service.
  4. Use netstat -tln to verify that MySQL is listening in localhost 127.0. 0.1:3306 port.

How do I change max concurrent connections in MySQL?

There are two ways to increase MySQL connections. Here’s the command to update max connections to 200 via MySQL command line tool without restart. mysql> set global max_connections = 200; The above command will increase max connections without restart but once the server is restarted, the changes will be gone.

How do I fix Error 2 in MySQL?

The code error 2 means that MySQL can’t find the . sql file that you want to execute. To solve this error, you need to provide the absolute path to your file location. You can find the absolute path of your file by opening the terminal in the directory or folder where your SQL file is located and run the pwd command.

Can’t connect to database connection refused?

A Connection Refused (Hostname) error occurs when: You use the wrong port in the connection string. You connect from a machine that is not in the database’s list of trusted sources.