linux arm源码编译MYSQL ODBC

2024年 4月 22日 114.2k 0

源码编译MYSQL ODBC

1.下载安装包
wget http://10.1.85.11:9000/infrastructure/mysql/mysql57/mysql-connector-odbc-5.3.13-src.tar.gz
wget http://10.1.85.11:9000/infrastructure/mysql/mysql57/unixODBC-2.3.12.tar.gz
wget http://10.1.85.11:9000/infrastructure/mysql/mysql57/mysql-5.7.44arm-linux-glibc2.12-x86_64.tar.gz

2.解压各类包
tar -zxvf ... -C /usr/local/

3.编译 unixODBC
./configure --prefix=/usr/local/unixODBC-2.3.12 --includedir=/usr/local/unixODBC-2.3.12/include --libdir=/usr/local/unixODBC-2.3.12/lib -bindir=/usr/local/unixODBC-2.3.12/bin --sysconfdir=/etc -bindir=/usr/local/unixODBC-2.3.12/bin

make
make install

测试
odbcinst -j
[root@sz-hx-zabbix-proxy105 unixODBC-2.3.12]# odbcinst -j
unixODBC 2.3.12
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

4.编译ODBC
yum install -y cmake
yum install -y gcc-c++
-----编译ODBC 5.7
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-connector-odbc-5.3.13 -DWITH_UNIXODBC=1
make
make install

注册
./myodbc-installer -d -a -n "MYSQL" -t "DRIVER=/usr/local/mysql-connector-odbc-5.3.13/lib/libmyodbc5w.so;SETUP=/usr/local/mysql-connector-odbc-5.3.13/lib/libmyodbc5w.so"

-----编译ODBC 8.0
cmake -G "Unix Makefiles"

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-connector-odbc-8.0.36 -DWITH_UNIXODBC=1

make
make install

注册
./myodbc-installer -d -a -n "MYSQL" -t "DRIVER=/usr/local/mysql-connector-odbc-8.0.36/lib/libmyodbc8w.so;SETUP=/usr/local/mysql-connector-odbc-8.0.36/lib/libmyodbc8w.so"

------测试
[root@sz-yb-zabbix-proxy107 bin]# cat /etc/odbcinst.ini
[MySQL ODBC 8.0]
DRIVER=/usr/local/mysql-connector-odbc-8.0.36/lib/libmyodbc8w.so
SETUP=/usr/local/mysql-connector-odbc-8.0.36/lib/libmyodbc8w.so
UsageCount=1

[MYSQL]
Driver=/usr/local/mysql-connector-odbc-5.3.13/lib/libmyodbc5w.so
SETUP=/usr/local/mysql-connector-odbc-5.3.13/lib/libmyodbc5w.so
UsageCount=1

[root@sz-yb-zabbix-proxy107 bin]# cat /etc/odbc.ini
[sz-yb-zndd-db-0001]
Description = sz-yb-zndd-db-0001
Driver = mysql
Server = 10.11.108.4
User = zabbix
Password = zabbix_2Ll
Port = 3306
Database = performance_schema

测试 isql -v sz-yb-zndd-db-0001

参考:

https://blog.csdn.net/huguangshanse00/article/details/98476479

https://www.cnblogs.com/flowjacky/p/4522849.html

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation-source-unix.html

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论