v icon indicating copy to clipboard operation
v copied to clipboard

mysql.h not found on RHEL 9

Open Jeffrey-de-Bruijn opened this issue 3 years ago • 2 comments

V version: 0.3.0 ec75860 OS: RHEL 9

What did you do? Downloaded V linux binary, attempted to test standard mysql library following the documentation

import mysql

// Create connection
mut connection := mysql.Connection{
    username: 'mysqlusr'
    dbname: 'mysqldb'
}
// Connect to server
connection.connect()?

This gives

builder error: 'mysql.h' not found

Package mysql-devel in installed and mysql.h is present

ls -lah /usr/include/mysql/mysql.h 
-rw-r--r--. 1 root root 33K Jul  1  2021 /usr/include/mysql/mysql.h

What did you expect to see? No errors

What did you see instead? Error

UPDATE: same error happens on Circle Linux 8.6

Jeffrey-de-Bruijn avatar Jul 05 '22 13:07 Jeffrey-de-Bruijn

From /usr/lib64/pkgconfig/mysqlclient.pc

prefix=/usr
includedir=${prefix}/include/mysql
libdir=${prefix}/lib64/mysql

Name: mysqlclient
Description: MySQL client library
Version: 21.1.26
Cflags: -I${includedir} -m64 
Libs: -L${libdir} -lmysqlclient
Libs.private:  -lpthread -ldl -lz -lresolv -lm -lrt
Requires.private: openssl

... which later V parses, but produces: -I "/usr/include/mysql -m64" ... instead of just: -I /usr/include/mysql -m64 -> the compilation failure.

spytheman avatar Jul 08 '22 06:07 spytheman

I ran into this problem today

einar-hjortdal avatar Mar 14 '23 20:03 einar-hjortdal

Try sudo dnf install mariadb-connector-c-devel.x86_64

itsalongstory avatar Sep 15 '23 03:09 itsalongstory

Try sudo dnf install mariadb-connector-c-devel.x86_64

The package conflicts with mysql-devel.

This problem was already confirmed, but not fixed yet

einar-hjortdal avatar Sep 15 '23 08:09 einar-hjortdal