[bash]
[root@localhost mysql-5.1.56]# ./configure --prefix=/usr/local/mysql/ \
--without-debug \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--enable-assembler \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=latin1,gb2312 \
--with-pthread --enable-thread-safe-client \
--with-plugins=myisam,innodb_plugin,innobase
[/bash]
在 client 使用命令
[sql]
mysql> INSERT PLUGIN plugin_name SONAME 'plugin_name.so';
[/sql]
提示如下错误
ERROR 1289 (HY000): The 'plugin' feature is disabled; you need MySQL built with 'HAVE_DLOPEN' to have it working
Bug #45605 是类似问题, 中间回复有一段说明产生如上错误是因为编译时有使用参数
--with-mysqld-ldflags=-all-static
- Why does the compilation process not recognize that Ubuntu default install supports HAVE_DLOPEN ?
Server was built with --with-mysqld-ldflags=-all-static
查资料时, 有说到在编译之前, 先设置如下两个环境变量就可以解决问题
[bash]
# export CFLAGS="-O2 -DHAVE_DLOPEN=1"
# export CXXFLAGS="-O2 -DHAVE_DLOPEN=1"
[/bash]
但我测试后, 编译倒完全不能通过. 不知道有木有人采用这种方法有解决了问题的?
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.