mysql报错
报错:
/tmp/ccBBJEB8.o: In function `ping_sql':
pingsql.c:(.text+0x7c): undefined reference to `mysql_init'
pingsql.c:(.text+0xe1): undefined reference to `mysql_real_connect'
pingsql.c:(.text+0xff): undefined reference to `mysql_close'
pingsql.c:(.text+0x119): undefined reference to `mysql_connect'
pingsql.c:(.text+0x198): undefined reference to `mysql_real_escape_string'
collect2: ld 返回 1
解决办法:
#gcc -o pingsql pingsql.c -lmysqlclient -I/usr/local/mysql/include/mysql/ -L/usr/local/mysql/lib/mysql
相关文档:
有时候nginx,apache,mysql,php编译完了想看看编译参数可以用以下方法
nginx编译参数:
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_mo ......
安装时的优化
(以下测试数据都来自于mysql的官方网站)
不要用rpm或其他二进制方式安装
要用源代码自己编译
如果是奔腾系统,推荐用pgcc编译器
且使用-O6的编译参数
这样编出来的mysql比用gcc2.95的要快1%
仅用用得着的字符集编译MySql
mysql目前支持多达34种不同的字符集(mysql4.1.11)
但我们常用的也无非就是lati ......
最近在做PHP与数据库交互的project,急于求成,模仿了下例子就开始动手,结果误把mysql_fetch_array写成了mysql_fetch_row,囧事来了,发现返回的数组居然是index=>value的形式,而明明记得是field name=>value的哈,查手册才明白。
1. mysql_fetch_array的函数原型是
array mysql_fetch_array ( resour ......
Connect MySQL GUI tools to WAMP 2.0
Posted by: Vladislav Sadykov ()
Date: January 24, 2009 09:31AM
Hay, I have a problem with MySQL database.
I have installed WAMP 2.0 server on my Windows machine and now I would like to
connect it with MySQL GUI tools 5.
The problem is that at the startup of ......