Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The compiling command of c mysql program under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The compiling command of c mysql program under Linux [@ more@] is better to use # gcc-o test test.c `mysql_config-- cflags-- libs`

Other compilation commands: # gcc-o test test.c-I/usr/include/mysql-L/usr/lib/mysql-lmysqlclient-lz-lm

# gcc-o test test.c-I / usr/include/mysql-L / usr/lib/mysql-l mysqlclient-lz-lm

Mysql_config: get compilation options for compilation customers

Mysql_config provides useful information about compiling MySQL clients and connecting them to MySQL. The following options are supported:

-- cflags: compiler flags, used to find include files, and key compiler flags and definitions to use when compiling libmysqlclient libraries.

-- include: compiler option for finding MySQL include files (note that "--cflags" should normally be used instead of this option).

-- libmysql-libs,--enbedded: libraries and options required to connect to MySQL embedded servers.

-- libs: libraries and options required to connect to MySQL client libraries.

-- libs_r: libraries and options required to link to thread-safe MySQL clients.

-- port: default tcp/ IP port number, defined when configuring MySQL.

-- socket: default Unix socket file, defined when configuring MySQL.

-- version: the version number and the MySQL distribution version.

Among them, mysql_config is in / usr/bin/mysql_config (this is the default directory after the rpm package is installed), and if it is installed by source code, it is usually installed in. / mysql/bin/mysql_config.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report