Linux????C/C++????mysql????????
???????????? ???????[ 2013/10/8 14:35:41 ] ????????
?????Linux?1????????
??????????? mount -t iso9660 /dev/cdrom /mnt/cdrom
????ж????? umount /dev/cdrom
???????????? eject
??????????? eject –t
????????????MySQL??譎???
????mysql-server-3.23.54a-11.i386.rpm
????mysql-3.23.54a-11.i386.rpm
????????MySQL???????????????
????mysql-devel-3.23.54a-11.i386.rpm
????????Linux???????????
????rpm –ivh ???????????
????rpm –qa | grep ??????????
????rpm –e ???????????
???????Linux??Mysql??????????
????/etc/rc.d/init.d/mysqld status ???????mysql??????
????service mysqld start ???mysql????
????mysql –u root –p pass ????????root??????pass????mysql?????
?????塢Linux C/C++????MySQL?????
??????????#include
???????????
????gcc -o server server.c –I /usr/include/mysql –L /usr/lib/mysql –l mysqlclient –lz –lm
????????????
????Step 1???????????
????????MYSQL mysql??
????mysql_init??&mysql?????????
????mysql_real_connect??&mysql??“hostname”??“username”??“password”??“database”??0??NULL??0????
????Step 2?????SQL???
????mysql_real_query??&mysql??SQL????
????Step 3???????????
????????MYSQL_RES?? *res??
????res = mysql_store_result??&mysql????
????Step 4??????????????У??????????????
????mysql_fetch_row??res????
????mysql_num_fields??res???? ?????????????
????printf??“%s
”??row[index]????
????Step 5????????
????mysql_free_result??res????
????mysql_close??&mysql????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11