Reputation: 728
My Python app that works on Fedora 26, does not work on Fedora 27.
I get this error:
ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory
I have created a new virtualenv after upgrading to Fedora 26. mariadb-devel is installed.
Upvotes: 8
Views: 4434
Reputation: 228
The Issue can be resolved by running the command
sed '/st_mysql_options options;/a unsigned int reconnect;' /usr/include/mysql/mysql.h -i.bkp
The fix is referred from https://github.com/DefectDojo/django-DefectDojo/issues/407
Upvotes: 12
Reputation: 536
This is a workaround:Add unsigned int reconnect;
in line 344 of file: /usr/include/mysql/mysql.h. The struct should look like this:
typedef struct st_mysql {
NET net; /* Communication parameters */
void *unused_0;
char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
char *info,*db;
const struct ma_charset_info_st *charset; /* character set */
MYSQL_FIELD *fields;
MA_MEM_ROOT field_alloc;
unsigned long long affected_rows;
unsigned long long insert_id; /* id if insert on table with NEXTNR */
unsigned long long extra_info; /* Used by mysqlshow */
unsigned long thread_id; /* Id for connection in server */
unsigned long packet_length;
unsigned int port;
unsigned long client_flag;
unsigned long server_capabilities;
unsigned int protocol_version;
unsigned int field_count;
unsigned int server_status;
unsigned int server_language;
unsigned int warning_count; /* warning count, added in 4.1 protocol */
unsigned int reconnect;
struct st_mysql_options options;
enum mysql_status status;
my_bool free_me; /* If free in mysql_close */
my_bool unused_1;
char scramble_buff[20+ 1];
/* madded after 3.23.58 */
my_bool unused_2;
void *unused_3, *unused_4, *unused_5, *unused_6;
LIST *stmts;
const struct st_mariadb_methods *methods;
void *thd;
my_bool *unbuffered_fetch_owner;
char *info_buffer;
struct st_mariadb_extension *extension;
} MYSQL;
Upvotes: 13
Reputation: 335
Try to reinstall MySQL-python using this:
sudo python -m pip install --no-binary MySQL-python MySQL-python
Upvotes: 0