You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mysqlclient fails to build for MySQL >= 8.3.0 #688
Unfortunately, the MySQL team finally killed a couple of the APIs they've been threatening to remove for a while now - mysql_kill, mysql_shutdown, and mysql_ssl_set.
I fixed the issue here: etripier@ee1882e. I'd be more than happy to submit a PR to your repo.
diff --git a/src/MySQLdb/_mysql.c b/src/MySQLdb/_mysql.c
index 0612be2..4282ab3 100644
--- a/src/MySQLdb/_mysql.c+++ b/src/MySQLdb/_mysql.c@@ -524,7 +524,11 @@ _mysql_ConnectionObject_Initialize(
mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile);
if (ssl) {
- mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);+ mysql_options(&(self->connection), MYSQL_OPT_SSL_KEY, key);+ mysql_options(&(self->connection), MYSQL_OPT_SSL_CERT, cert);+ mysql_options(&(self->connection), MYSQL_OPT_SSL_CA, ca);+ mysql_options(&(self->connection), MYSQL_OPT_SSL_CAPATH, capath);+ mysql_options(&(self->connection), MYSQL_OPT_SSL_CIPHER, cipher);
}
if (ssl_mode) {
#ifdef HAVE_ENUM_MYSQL_OPT_SSL_MODE
@@ -1789,10 +1793,11 @@ _mysql_ConnectionObject_kill(
{
unsigned long pid;
int r;
+ char query[50];
if (!PyArg_ParseTuple(args, "k:kill", &pid)) return NULL;
check_connection(self);
Py_BEGIN_ALLOW_THREADS
- r = mysql_kill(&(self->connection), pid);+ r = mysql_query(&(self->connection), snprintf(query, 50, "KILL %d", pid));
Py_END_ALLOW_THREADS
if (r) return _mysql_Exception(self);
Py_RETURN_NONE;
@@ -2008,7 +2013,7 @@ _mysql_ConnectionObject_shutdown(
int r;
check_connection(self);
Py_BEGIN_ALLOW_THREADS
- r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);+ r = mysql_query(&(self->connection), "SHUTDOWN");
Py_END_ALLOW_THREADS
if (r) return _mysql_Exception(self);
Py_RETURN_NONE;
To install from etripier's commit: pip install -e git+https://github.com/etripier/mysqlclient.git@ee1882e02e3c73910b1d6df86bbdce784edbb881#egg=mysqlclient
And don't trust me - make sure the commit id ee1...881 is what etripier links to above.
Reacted by CarterT7, David Ding, SWDive, Phạm Huy Cường Thịnh, Anton Iakovlev, Xin, Dmitry Chekhonin, Hamza Ironside, 46gom and Michael Skinner
Question: How far back will your changes work? Will it work back for myself 5.6* series? MariaDB 5.5? We are slowly transitioning from Centos 7 - which reaches EOL this year. Will your changes break things?
If you're using Homebrew, upgraded to 8.3.0 already, and aren't ready to upgrade your client library to 2.2.4, I put some simple instructions to get your dev environment working again: https://i-am-j.ag/blog/posts/python-mysql-8.3.0-homebrew/
Reacted by Kimberly Fawbush, Nobuo Saeki, Quynh Tran, Oleg Morozenkov, fj3170 and OwlCJ
Activity
methane commentedon Jan 30, 2024
thanks.
phnahes commentedon Jan 30, 2024
Thanks!!! It worked for me!! :)
zaphod72 commentedon Jan 30, 2024
To install from etripier's commit:
pip install -e git+https://github.com/etripier/mysqlclient.git@ee1882e02e3c73910b1d6df86bbdce784edbb881#egg=mysqlclientAnd don't trust me - make sure the commit id
ee1...881is what etripier links to above.Albertrrrr commentedon Jan 31, 2024
Deeply thanks!!
epeisach commentedon Feb 2, 2024
Question: How far back will your changes work? Will it work back for myself 5.6* series? MariaDB 5.5? We are slowly transitioning from Centos 7 - which reaches EOL this year. Will your changes break things?
mysql 5.6 series does define MYSQL_OPT_SSL *
methane commentedon Feb 3, 2024
I don't know. They are not supported version.
If you are interested in it, take your time to check them.
Support MySQL 8.3 (#690)
Bump mysqlclient
Bump mysqlclient
j00bar commentedon Feb 12, 2024
If you're using Homebrew, upgraded to 8.3.0 already, and aren't ready to upgrade your client library to 2.2.4, I put some simple instructions to get your dev environment working again: https://i-am-j.ag/blog/posts/python-mysql-8.3.0-homebrew/