如果在编译“sql_yacc.cc”时,你得到如下的一个错误,你可能是存储器或交换空间溢出: Internal compiler error: program cc1plus got fatal signal 11 或 Out of virtual memory 或 Virtual memory exhausted
如果你的编译以下面任何错误而失败,你必须升级make版本到GNUmake: making all in mit-pthreads make: Fatal error in reader: Makefile, line 18: Badly formed macro assignment or make: file `Makefile'''' line 18: Must be a separator (: or pthread.h: No such file or directory
Solaris和FreeBSD已知make程序有问题。GNU make版本3.75已知能工作。
如果你想要定义你的C或C++编译器所使用的标志,把标志加到CFLAGS和CXXFLAGS环境变量中即可。你也能使用CC和CXX来指定编译器名字。例如: shell>CC=gcc shell>CFLAGS=-O6 shell>CXX=gcc shell>CXXFLAGS=-O6 shell>export CC CFLAGS CXX CXXFLAGS
如果你在编译mysqld时显示例如下面的那些错误, configure没有正确地检测传到accept()、getsockname()或getpeername()最后参数的类型: cxx: Error: mysqld.cc, line 645: In this statement, the referenced type of the pointer value "&length" is "unsigned long", which is not compatible with "int". new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
为了修正它,编辑“config.h”文件(它由configure生成)。寻找这些行:
/* Define as the base type of the last arg to accept */ #define SOCKET_SIZE_TYPE XXX
MIT-pthreads不支持用于实现Unix套接字的AF_UNIX协议。这意味着如果你使用MIT-pthreads进行编译,所有的链接必须使用TCP/IP进行(它有点慢)。如果在构造MySQL后,你发现你不能与本地的服务器连接,很可能是客户程序正在试图用缺省的Unix套接字与localhost连接。使用主机选择(-h或--host)明确地指定本地的主机名字,尝试做一个TCP/IP连接到mysql。 决定是否使用MIT-pthreads的检查仅在处理服务器代码的配置过程期间发生。如果已经用--without-server配置了分发并只构造客户代码,客户将不知道MIT-pthreads是否正在被使用并且是否使用缺省的Unix套接字连接。因为Unix套接字不能在MIT-pthreads下面工作,这意味着当你运行客户程序时,你将需要使用-h或--host。 当使用MIT-pthreads编译MySQL时,因为性能原因,系统锁定缺省为禁止使用。你可以用--use-locking选项告诉服务器使用系统锁定。 有时pthreadbind()命令不能绑定一个套接字但没有任何错误消息(至少在Solaris上),结果是所有到服务器的连接均失败。例如: shell> mysqladmin version mysqladmin: connect to server at '''''''' failed; error: ''''Can''''t connect to mysql server on localhost (146)''''
解决它的方法是杀死mysqld服务器并且重启它。这只有当我们强迫服务器停止并马上进行重启时在发生。
使用MIT-pthreads,sleep()系统调用不是可中断的SIGINT(break)。这只有在你运行mysqladmin --sleep时才能注意到。你在中断起作用并且进程停止之前必须等待sleep()终止。 当链接时,你可能会收到这样的警告消息(至少在Solaris上);他们可以被忽视: ld: warning: symbol `_iob'''' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken ld: warning: symbol `__iob'''' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
一些其他的警告也可被忽略: implicit declaration of function `int strtoll(...)'''' implicit declaration of function `int strtoul(...)''''