Skip to content

Comments

Add SSL cert/key support to MySQL schema dump and load (#57821)#58690

Merged
taylorotwell merged 1 commit intolaravel:12.xfrom
HeathNaylor:bugfix/mysql-schema-ssl-options
Feb 9, 2026
Merged

Add SSL cert/key support to MySQL schema dump and load (#57821)#58690
taylorotwell merged 1 commit intolaravel:12.xfrom
HeathNaylor:bugfix/mysql-schema-ssl-options

Conversation

@HeathNaylor
Copy link
Contributor

Fixes #57821

When using PDO SSL client certificate options MYSQL_ATTR_SSL_CERT and MYSQL_ATTR_SSL_KEY, the mysqldump and mysql commands were not getting the corresponding --ssl-cert and --ssl-key flags. This causes auth failures for users with client certs.

I added --ssl-cert and --ssl-key CLI flag support to MySqlSchemaState::connectionString() when PDO::MYSQL_ATTR_SSL_CERT and PDO::MYSQL_ATTR_SSL_KEY options are configured. MariaDbinherits the fix automatically.

I tested this on MySQL 9.3.0 by generating self signed certs and required X509 for a new user (CREATE USER 'laravel_ssl'@'localhost' IDENTIFIED BY 'secret' REQUIRE X509). I configured the config/database.php and added the MYSQL_ATTR_SSL_CA, MYSQL_ATTR_SSL_CERT, MYSQL_ATTR_SSL_KEY options. I then ran php artisan schema:dump and php artisan migrate which succeeded over TLS.

@HeathNaylor HeathNaylor force-pushed the bugfix/mysql-schema-ssl-options branch from a5300d8 to 5ca431d Compare February 8, 2026 06:41
@HeathNaylor HeathNaylor force-pushed the bugfix/mysql-schema-ssl-options branch from 5ca431d to fb14197 Compare February 8, 2026 06:42
@taylorotwell taylorotwell merged commit facf696 into laravel:12.x Feb 9, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot migrate a schema.dump file using SSL/TLS with MySQL driver or disable SSL mode in Illuminate/Database/Schema/MySqlSchemaState

2 participants