Warning
Error Code:
1759
MySQL Error 1759: Insecure Plain Text Password
Description
This error indicates that a client application is attempting to send a user password to the MySQL server without the protection of SSL/TLS encryption. This poses a significant security risk, as the password could be intercepted by unauthorized parties during transmission.
Error Message
Sending passwords in plain text without SSL/TLS is extremely insecure.
Known Causes
3 known causesClient SSL/TLS Disabled
The client application or tool attempting to connect to MySQL is not configured to use SSL/TLS for encrypted communication.
Server Lacks SSL/TLS Support
The MySQL server itself is not configured to accept SSL/TLS connections, or its SSL/TLS certificates are missing or invalid.
Explicit Plain Text Authentication
The client is explicitly configured to use an authentication plugin that sends passwords in plain text, even if SSL/TLS might be available.
Solutions
3 solutions available1. Enforce SSL/TLS for Client Connections advanced
Configure the MySQL server to require SSL/TLS for all client connections.
1
Ensure your MySQL server is configured to support SSL/TLS. This typically involves generating or obtaining SSL certificates and keys.
2
Modify the MySQL server configuration file (e.g., `my.cnf` or `my.ini`) to enable SSL and potentially enforce it for all connections. Restart the MySQL server after making changes.
# Example my.cnf snippet (location varies by OS):
[mysqld]
ssl_ca=/path/to/your/ca.pem
ssl_cert=/path/to/your/server-cert.pem
ssl_key=/path/to/your/server-key.pem
require_secure_transport=ON
3
For each user account that needs to connect, grant them the ability to connect using SSL/TLS. If `require_secure_transport` is ON, this will be implicitly enforced.
ALTER USER 'username'@'host' REQUIRE SSL;
4
When connecting from a client application, ensure it is configured to use SSL/TLS. This often involves specifying the CA certificate, client certificate, and client key in the connection string or configuration.
# Example connection string (language dependent):
mysql --ssl-ca=/path/to/ca.pem --ssl-cert=/path/to/client-cert.pem --ssl-key=/path/to/client-key.pem -u username -h hostname database
2. Upgrade Client Connector and Configure SSL medium
Update your application's MySQL connector and configure it to use SSL/TLS for connections.
1
Identify the MySQL connector or library your application uses (e.g., `mysql.connector` for Python, `mysql2` for Node.js, JDBC driver for Java).
2
Update the connector to the latest stable version to ensure it supports modern SSL/TLS protocols and options.
# Example for Node.js with npm:
npm install mysql2@latest
3
Modify your application's database connection code to include SSL/TLS parameters. This will vary depending on the connector, but typically involves specifying `ssl: true` or providing paths to certificate files.
# Example for Node.js with mysql2:
const mysql = require('mysql2');
const connection = mysql.createConnection({
host: 'your_host',
user: 'your_user',
password: 'your_password',
database: 'your_database',
ssl: {
ca: require('fs').readFileSync('/path/to/your/ca.pem')
// Other SSL options like rejectUnauthorized might be needed
}
});
4
Ensure the MySQL server is configured to accept SSL connections and that the necessary certificates are available on the server.
3. Use MySQL Native Password Authentication with Secure Connections medium
Switch to the `caching_sha2_password` authentication plugin and ensure connections are made over SSL/TLS.
1
Verify that your MySQL server version supports `caching_sha2_password` (MySQL 8.0+).
2
Modify the MySQL server configuration file (e.g., `my.cnf` or `my.ini`) to set the default authentication plugin to `caching_sha2_password` and ensure SSL is enabled.
# Example my.cnf snippet:
[mysqld]
default_authentication_plugin=caching_sha2_password
ssl_ca=/path/to/your/ca.pem
ssl_cert=/path/to/your/server-cert.pem
ssl_key=/path/to/your/server-key.pem
3
For existing users, change their authentication plugin to `caching_sha2_password` and require SSL. For new users, specify this plugin during creation.
ALTER USER 'username'@'host' IDENTIFIED WITH caching_sha2_password REQUIRE SSL;
4
Ensure your client applications and connectors are updated to support `caching_sha2_password` and are configured to connect using SSL/TLS.