All Collections
Connecting
Connecting to MySQL
Connecting to MySQL

What common connection errors with MySQL mean, and how to resolve them

Tejas Sachdeva avatar
Written by Tejas Sachdeva
Updated over a week ago

The error codes you receive will depend not only on the information you provide, but also your own particular infrastructure (i.e., type of database, whether you're behind a firewall, etc.).  We've tried to provide explanations of he most common error codes we see customers face, but if you don't see yours here, feel free to ping us in the in-product chat, or book some time and we'd be happy to help you get connected!

Or see here for MySQL's troubleshooting guide.

Common Errors

ER_NOT_SUPPORTED_AUTH_MODE

There is an issue with your authentication, which sometimes happens when you upgrade.  You can reset your authentication mode to the default by running the following in mysqladmin.

use mysql;
update user set authentication_string=password(''), plugin='mysql_native_password' where user='root';
flush privileges;

See here for more detail.

ETIMEDOUT

One of several errors that indicate an unavailable network host.

  1. Double check your Database Type and Port.  We often see the two are mismatched in these situations.  The default port for MySQL is 3306.

  2. If you have the ability to check your connection using another editor or IDE and the same authentication credentials, that can rule out access issues.  If you are able to connect, please contact us in the in-product chat to continue trouble-shooting.  If not, or you don't have access to another editor, continue with the steps below.

  3. Is the database online?  From mysqladmin run:

# mysqladmin -u root -p ping

Enter password:
mysqld is alive

4. Does the user have access?  From mysqladmin run: 

mysql> SHOW GRANTS FOR ana_index@localhost;
| GRANT USAGE ON *.* TO 'ana_index'@'localhost' IDENTIFIED BY PASSWORD '*...'
| GRANT ALL PRIVILEGES ON `test`.* TO 'ana_index'@'localhost'

where 'ana_index' is the user who is trying to get access and 'test'.  The resulting table mysql.db will tell you what permissions, if any, the user has.  See here for more detail.

5. Do you have access to your database from the IP address you are currently using?  If your database is behind a firewall, you may need to whitelist your IP address.  While you're at it, consider whitelisting SeekWell's static IP address as well, as that will be necessary to set an automated schedule.

ECONNREFUSED

Similar steps to the ETIMEDOUT error above.  After double-checking your Database Type and Port, you may want to verify that your MySQL server responds to a TCP port by adding the following to the connection options:

port: '/var/run/mysqld/mysqld.sock'

See the second answer here for more detail.

ENOTFOUND

This is usually a problem with the host string.  Try 'localhost' or '127.0.0.1' in the host field.  See here for more detail.

ER_ACCESS_DENIED_ERROR
ER_DBACCESS_DENIED_ERROR
ER_HOST_NOT_PRIVILEGED

Usually this is an issue with either your credentials (i.e., a typo) or the tables that grant access to users or projects..  Search for "access denied for user" (view all four instances) on this page for detailed steps to resolve.

Or using mysqladmin run:

GRANT ALL PRIVILEGES ON *.* TO 'YourUserName'@'ec2-52-34-31-72.us-west-2.compute.amazonaws.com' IDENTIFIED BY "YourPassword";

with your actual user name and password.

If your database is behind a firewall, this could also be a firewall issue, and you may need to whitelist your IP address.  While you're at it, consider whitelisting SeekWell's static IP address as well, as that will be necessary to set an automated schedule.


Again, please feel free to contact us if you're having trouble connecting!  We can usually get you connected in a matter of minutes, and helping you helps us better understand how to write guides like this!  Chat from within the product, email us atcontact@seekwell.io or grab 15 minutes here.

Did this answer your question?