关于安装mysql的问题~~~~~~
时间:2008-01-16 12:04:51 来源: 作者:
|
我看了论坛里的帖子http://chinaunix.net/forum/viewtopic.php?t=16493&highlight=proftpd 按照安装步骤,到了该做./configure --prefix=/usr/local/mysql的时候出现了错误,提示是:checking return type of sprintf... configure: error: can not run test program while cross compiling 请问这是怎么回事?我该怎么做? py 回复于:2003-06-03 17:42:47 是到这里出错的: # ./configure --prefix=/usr/local/mysql loading cache ./config.cache checking host system type... sparc-sun-solaris2.8 checking target system type... sparc-sun-solaris2.8 checking build system type... sparc-sun-solaris2.8 checking for a BSD compatible install... ./install-sh -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... (cached) yes checking for working aclocal... missing checking for working autoconf... found checking for working automake... missing checking for working autoheader... missing checking for working makeinfo... missing checking whether to enable maintainer-specific portions of Makefiles... no checking whether build environment is sane... yes checking whether make sets ${MAKE}... (cached) yes checking for gawk... (cached) nawk checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking for c++... (cached) c++ checking whether the C++ compiler (c++ ) works... yes checking whether the C++ compiler (c++ ) is a cross-compiler... yes checking whether we are using GNU C++... (cached) yes checking whether c++ accepts -g... (cached) yes checking how to run the C preprocessor... (cached) gcc -E checking for ranlib... (cached) ranlib checking for ld used by GCC... (cached) /usr/ccs/bin/ld checking if the linker (/usr/ccs/bin/ld) is GNU ld... (cached) no checking for BSD-compatible nm... (cached) /usr/ccs/bin/nm -p checking whether ln -s works... (cached) yes loading cache ./config.cache within ltconfig checking for object suffix... o checking for executable suffix... (cached) no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions ... yes checking if gcc static flag -static works... -static checking if the linker (/usr/ccs/bin/ld) is GNU ld... no checking whether the linker (/usr/ccs/bin/ld) supports shared libraries... yes checking command to parse /usr/ccs/bin/nm -p output... ok checking how to hardcode library paths into programs... immediate checking for /usr/ccs/bin/ld option to reload object files... -r checking dynamic linker characteristics... solaris2.8 ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for objdir... .libs creating libtool loading cache ./config.cache checking for a BSD compatible install... ./install-sh -c checking for bison... bison -y checking for pdftex... no checking return type of sprintf... configure: error: can not run test program wh ile cross compiling # 南非蜘蛛 回复于:2003-06-03 17:59:42 gcc和make的版本是什么? py 回复于:2003-06-03 18:32:23 gcc是2.95.3 make是3.80 py 回复于:2003-06-03 18:33:42 刚才我换了一个mysql的版本,现在./configure --prefix=/usr/local/mysql 的时候就没事了,可在make的时候又有这样的错误: ld.so.1: ./gen_lex_hash: fatal: libstdc++.so.2.10.0: open failed: No such file o r directory Killed make[3]: *** [lex_hash.h] Error 137 make[3]: Leaving directory `/export/spare/temp/mysql-3.23.53/sql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/export/spare/temp/mysql-3.23.53/sql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/export/spare/temp/mysql-3.23.53' make: *** [all-recursive-am] Error 2 # py 回复于:2003-06-03 18:58:04 引用:原帖由 "南非蜘蛛"]gcc和make的版本是什么? 发表: 我翻看了所有相关的帖子,看到你曾经说过“mysql十分挑gcc和make的版本 ”,那gcc和make要什么版本才可以呀?版本越高越好吗?还有看到有人说要装ncurses包,请问ncurses包具体是起什么作用的?(感谢版主!) noress 回复于:2003-06-03 19:14:02 要注意你的环境变量啊! 安装了gcc,gmake,你还得保证用的就是它! 看看你的PATH变量,要把gcc,gmake在的目录放在前面! 还有最好,在./configure时,最好加上CC=gcc,CXX=gcc py 回复于:2003-06-03 20:37:25 现在我已经make过了,要是重新./configure是不是应该先make clean? elk 回复于:2003-06-03 20:47:22 少C标准函数库 在SUNFREEWARE.COM libsdtc py 回复于:2003-06-03 21:21:36 引用:原帖由 "elk" 发表: 少C标准函数库 在SUNFREEWARE.COM libsdtc 我在SUNFREEWARE.COM上怎么没找到libsdtc搜索也搜索不到呀? firebird 回复于:2003-06-03 22:46:47 你少了个工具吧,sunfreeware上有,叫ncurses的。 elk 回复于:2003-06-03 23:59:43 你是SOLARIS几? elk 回复于:2003-06-04 00:01:57 ftp://ftp.sunfreeware.com/pub/freeware/sparc/7/libstdc++-2.8.1.1-sol7-sparc-local.gz 8也可以用的 cuiy 回复于:2003-06-04 00:05:48 如果只是configure的话,不需要make clean,除非你需要重新编译 py 回复于:2003-06-04 00:35:10 这次我安装了ncurses-5.3-sol8-sparc-local.gz也把重新安装了gcc-3.2.2-sol8-sparc-local.gz 以前的错误没有了,估计是我安装了较高版本的gcc也就找到了c函数库。 安装的时候我用了 #CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3" ./configure --prefix=/usr/local/mysql --with-low-memory 没有错误,然后make,提示是: sql_lex.cc:85: `symbols' undeclared (first use this function) sql_lex.cc:85: (Each undeclared identifier is reported only once for each function it appears in.) sql_lex.cc:87: `sql_functions' undeclared (first use this function) sql_lex.cc: In function `int find_keyword(LEX*, unsigned int, bool)': sql_lex.cc:168: `get_hash_symbol' undeclared (first use this function) make[3]: *** [sql_lex.o] Error 1 make[3]: Leaving directory `/export/spare/temp/mysql-3.23.53/sql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/export/spare/temp/mysql-3.23.53/sql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/export/spare/temp/mysql-3.23.53' make: *** [all-recursive-am] Error 2 # 请各位高手看看该如何解决? py 回复于:2003-06-04 00:38:12 引用:原帖由 "elk" 发表: ftp://ftp.sunfreeware.com/pub/freeware/sparc/7/libstdc++-2.8.1.1-sol7-sparc-local.gz 8也可以用的 我也看了libstdc++的readme,里面说libstdc++已经包含在了gcc里,所以我就下载了一个较高版本的gcc-3.2.2 py 回复于:2003-06-05 07:58:29 问题还是没能解决,在sun的网站上说是要先安装zlib-1.1.4-sol8-sparc-local.gz,成功安装以后我试着换了个mysql版本, 安装了mysql-3.23.55.tar.gz,这次比较顺利,整个过程都没出现“error”,可我还是觉得好象没成功, 也不知道成功make以后会不会有个“successful”之类的说明?我make install以后没出现“error”的提示, 不知道是不是就是安装成功了。后来按照精华贴里的步骤做了chown和数据库初始化, 最后在做#/usr/local/mysql/bin/safe_mysqld时提示是这样的: Starting mysqld daemon with databases from /usr/local/mysql/var 030604 18:40:09 mysqld ended 我用#/usr/local/mysql/bin/mysql启动mysql的时候提示: ld.so.1: /usr/local/mysql/bin/mysql: fatal: libncurses.so.5: open failed: No such file or directory Killed 请问我该怎么办?我的mysql是否安装成功了? 南非蜘蛛 回复于:2003-06-05 08:33:09 install libncurses firebird 回复于:2003-06-05 08:36:58 我看是安装成功了,关键一步scripts/mysql_install_db执行了吗? 你用mysql连接数据库的时候,要求连接libncurses.so.5,但是你把安装ncurses的路径放到LD_LIBRARY_PATH 里面了吗,你在连数据库的时候,系统自动到LD_LIBRARY_PATH路径里搜寻。 还有,任何错误都可以在你的/PATH/TO/MYSQL/var/HOSTNAME.err里面找到。 不行请跟帖。 py 回复于:2003-06-05 10:27:54 scripts/mysql_install_db执行了 我在google里搜索到了很多有关LD_LIBRARY_PATH的东西,但都没说怎么把安装ncurses的路径放到LD_LIBRARY_PATH 里,小弟很菜,能不能详细说说加路径的方法? 另外我的libncurses.so.5是在/usr/local/lib下,HOSTNAME.err我也看了,里面反复重复的错误都是下面的这几行: 030605 09:43:03 mysqld started 030605 9:43:06 /usr/local/mysql/libexec/mysqld: Can't find file: './mysql/host .frm' (errno: 13) 030605 9:43:06 /usr/local/mysql/libexec/mysqld: Normal shutdown 030605 09:43:06 mysqld ended mol008 回复于:2003-06-05 10:46:58 应该是你MYSQL用户的权限不够,errno:13见如下: #define EACCES 13 /* Permission denied */ py 回复于:2003-06-05 11:11:36 我是按照精华贴里创建用户的, #useradd -d /usr/local/mysql/var -s /bin/false mysql 不过我还是觉得错误在libncurses.so.5的路径上,不然不会在safe_mysqld时出错吧? jogs 回复于:2003-06-05 11:27:20 编译一些免费软件尽量用gnu的gcc和make 我最近在solaris 9上编译uscpi的时候打完补丁还出问题,结果换一个gnu的make就一路顺畅的编译完了 你可以试试 还有你mysql的启动错误应该是编译的时候没有指定启动mysql的用户 你用root用户起一下试试 py 回复于:2003-06-05 11:44:18 引用:原帖由 "jogs" 发表: 编译一些免费软件尽量用gnu的gcc和make 我最近在solaris 9上编译uscpi的时候打完补丁还出问题,结果换一个gnu的make就一路顺畅的编译完了 你可以试试 还有你mysql的启动错误应该是编译的时候没有指定启动mysql的?......... 我一直在用root的,没有指定mysql用户?那就是说我用重新编译了?还有你说的gnu的make,我也听说make很爱出错所以用了make-3.80-sol8-sparc-local.gz,如果用gnu的make.tar.gz,那在#./configure 时要不要加什么参数? firebird 回复于:2003-06-05 11:56:35 这个问题简单啊, vi /.proifle,增加如下: LD_LIBRARY_PATH=/usr/lib:/usr/local/lib export LD_LIBRARY_PATH 另外一种方法:用crle看一下系统默认的连接库,正常应该是/usr/lib 然后你用命令crle -u -l /usr/local/lib增加进新的路径。 firebird 回复于:2003-06-05 11:58:04 另外你看看mysql的源代码安装文档: shell>; groupadd mysql shell>; useradd -g mysql mysql shell>; gunzip < mysql-VERSION.tar.gz | tar -xvf - shell>; cd mysql-VERSION shell>; ./configure --prefix=/usr/local/mysql shell>; make shell>; make install shell>; scripts/mysql_install_db shell>; chown -R root /usr/local/mysql shell>; chown -R mysql /usr/local/mysql/var shell>; chgrp -R mysql /usr/local/mysql shell>; cp support-files/my-medium.cnf /etc/my.cnf shell>; /usr/local/mysql/bin/safe_mysqld --user=mysql & 这个步骤绝对正确。 jogs 回复于:2003-06-05 12:12:33 你那个make应该也可以用 对 按照firebird的步骤应该不会有问题 特别是那几步该权限的一定要做 py 回复于:2003-06-05 12:47:55 好,我这就去重编译! :D py 回复于:2003-06-05 14:17:21 引用:原帖由 "firebird" 发表: 另外你看看mysql的源代码安装文档: shell>; groupadd mysql shell>; useradd -g mysql mysql shell>; gunzip < mysql-VERSION.tar.gz | tar -xvf - shell>; cd mysql-VERSION shell>; ./configur.......... 我的系统是solaris8 sparc,按照你的步骤做到了。但到了make的时候就开始报错了,提示: ld.so.1: ./gen_lex_hash: fatal: libstdc++.so.5: open failed: No such file or dir ectory make[4]: *** [lex_hash.h] Error 137 make[4]: Leaving directory `/export/spare/temp/mysql-3.23.55/sql' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/export/spare/temp/mysql-3.23.55/sql' make[2]: *** [all] Error 2 make[2]: Leaving directory `/export/spare/temp/mysql-3.23.55/sql' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/export/spare/temp/mysql-3.23.55' make: *** [all] Error 2 # 以前我看到你说,分别用gunzip,tar和放在一起用不一样,我也试了分别用gunzip和tar,结果错误提示一样。后来我在./configure这部的时候加了很多参数: #CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --with-extra-charsets=all 这样在make的时候就没出问题。不过我还是觉得提示奇怪,在make时最后几行的提示是: binary-configure.sh >; binary-configure-t /usr/bin/mv binary-configure-t binary-configure make[2]: Leaving directory `/export/spare/temp/mysql-3.23.55/support-files' Making all in os2 make[2]: Entering directory `/export/spare/temp/mysql-3.23.55/os2' Making all in include make[3]: Entering directory `/export/spare/temp/mysql-3.23.55/os2/include' Making all in sys make[4]: Entering directory `/export/spare/temp/mysql-3.23.55/os2/include/sys' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/export/spare/temp/mysql-3.23.55/os2/include/sys' make[4]: Entering directory `/export/spare/temp/mysql-3.23.55/os2/include' make[4]: Nothing to be done for `all-am'. make[4]: Leaving directory `/export/spare/temp/mysql-3.23.55/os2/include' make[3]: Leaving directory `/export/spare/temp/mysql-3.23.55/os2/include' make[3]: Entering directory `/export/spare/temp/mysql-3.23.55/os2' make[3]: Nothing to be done for `all-am'. make[3]: Leaving directory `/export/spare/temp/mysql-3.23.55/os2' make[2]: Leaving directory `/export/spare/temp/mysql-3.23.55/os2' make[1]: Leaving directory `/export/spare/temp/mysql-3.23.55' # 这是成功安装了吗? firebird 回复于:2003-06-05 14:45:42 成功与否,你连一下数据库看看。 还有,你不要用SUN自带的tar,用GNU的tar,如下: tar xzvf mysql-VERSION.tar.gz,然后按照前面的方法,把/usr/local/lib的库路径加如系统,还有干脆把autoconf,automake都安装好吧,是不是必需我也清楚,但是我就是按照这个方法编译的,从没失败过啊。 py 回复于:2003-06-05 14:50:16 这次好象是成功了吧? # chown -R root /usr/local/mysql # chown -R mysql /usr/local/mysql/var # chgrp -R mysql /usr/local/mysql # cp support-files/my-medium.cnf /etc/my.cnf # /usr/local/mysql/bin/safe_mysqld --user=mysql & 5448 # Starting mysqld daemon with databases from /usr/local/mysql/var # ps PID TTY TIME CMD 5448 console 0:00 safe_mys 330 console 0:00 sh 5468 console 0:00 ps # 重起以后mysql的进程已经起来了。 南非蜘蛛 回复于:2003-06-05 15:21:00 我昨天也安装了一把,也出现了和你一样的两个错误,今天总算搞定,mysql必须要gcc2。95。3 py 回复于:2003-06-05 16:05:27 引用:原帖由 "南非蜘蛛"]我昨天也安装了一把,也出现了和你一样的两个错误,今天总算搞定,mysql必须要gcc2。95。3 发表: 我觉得装mysql几乎就是碰运气,mysql,gcc,make版本选合适了就ok,差一点都会出怪问题。主要是gcc,不知道要是用cc是不是就什么事都没有了?最后说一下我选的版本,我的系统是solaris8 sparc mysql-3.23.55.tar.gz gcc-3.2.2-sol8-sparc-local.gz make-3.80-sol8-sparc-local.gz gzip-1.3.5-sol8-sparc-local tar-1.13.tar.gz 另外我还装了一些相关的软件 ncurses-5.3-sol8-sparc-local.gz(一定要) autoconf-2.57-sol8-sparc-local.gz (精华贴中说要装的) automake-1.7.2-sol8-sparc-local.gz (精华贴中说要装的) bison-1.875-sol8-sparc-local.gz (精华贴中说要装的) zlib-1.1.4-sol8-sparc-local.gz(这是sun网站上要求安装的) 有的时候在make的时候说缺少libstdc++,我看了它的说明文档,它已经包含在了高版本的gcc中,所以如果编译的时候出现了这样的错误估计就是mysql或是gcc的版本选的不合适了,另外我在./configure的时候参数是这么用的: #CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --with-extra-charsets=all 如果只用./configure --prefix=/usr/local/mysql就会报错,错误提示就像前面说的一样。同样的方法我在装mysql的时候还用过3.23.47和3.23.53以及4.0.13都没能成功,估计是这个gcc的版本比较适合3.23.55,也可能是我的运气太差了,不过折腾了两天最后装上了还是比较高兴。 希望这些东西能给大家一点帮助。 最后要感谢所有在楼上帮助过我的朋友,谢谢! paradise 回复于:2003-06-05 16:10:22 我编译怎么重来没碰到过问题?莫非它怕我?呵呵,我是用gcc 3.2.3 mysql-4.0.12.tar.gz solaris 8 x86 or solaris 9 sparc 南非蜘蛛 回复于:2004-02-16 16:09:42 xsolaris安装mysql,其实很简单,我找到easy的方法了 py 回复于:2004-02-16 17:34:43 引用:原帖由 "南非蜘蛛"]xsolaris安装mysql,其实很简单,我找到easy的方法了 发表: 是吗?怎么弄的?我后来再装mysql4。0的时候就再没遇到什么问题 yunyangx 回复于:2004-05-14 17:38:37 我都搞了好几天了,还是不行呀。 Xsolaris上。 py 回复于:2004-05-14 21:28:19 呵呵,多试试就好了,刚开始都是装mysql。 blueproton 回复于:2006-10-11 11:04:15 晕倒,装好了mysql,也正常进入,结果;showdatabases,显示无法查询,不能用!! blueproton 回复于:2006-10-11 11:24:08 重新解压再装, ./configure --prefix=/usr/local/mysql 配置后,提示os2/makefile no input没有生成,make也进行不了 这是怎么回事啊,我的是sparc8 |
原文链接:http://bbs.chinaunix.net/viewthread.php?tid=83729 转载请注明作者名及原文出处 |
上一篇: FE-1的考后感
下一篇: 磁带设备使用方法总结(偶写地)










文章评论
共有 位网友发表了评论 查看完整内容