【求助】MYSQL 用 TARBALL 安裝時的幾個疑問請教



贊助商連結


b90220208
2005-08-05, 10:46 PM
請教一下幾個問題:

mysql文件中有提到開機自動執行的做法:
you can copy 'support-files/mysql.server' to the location where your system has its startup files.
請問它意思是複製mysql.server到哪裡?
此方式如何以普通身分啟動mysqld呢?(例如: /usr/local/mysql/bin/mysqld_safe --user=mysql &)


if you want to set up an option file:
shell> cp support-files/my-medium.cnf /etc/my.cnf
我看了一下 support-files 這個目錄,裡面類似的檔案還有兩個: 分別是 my-huge.cnf 與 my-small.cnf
這些是設定檔嗎? 請教我該如何選擇? 這動作一定要做嗎?

贊助商連結


repsol
2005-08-08, 11:00 AM
1. you can copy 'support-files/mysql.server' to the location where your system has its startup files.

這句話是問你自己


2. 此方式如何以普通身分啟動mysqld呢?

開啟這支 mysql.server 去看看就知道了

3.這些是設定檔嗎? 請教我該如何選擇? 這動作一定要做嗎?

怎麼選擇要看你的需求
不一定要做,系統會用 default 值啟動

b90220208
2005-08-19, 01:10 PM
感謝您的回應:
以下是我執行過./configure後的訊息(stdout),不知有什麼嚴重疏失導致無法正確產生Makefile??
==========================================================
[root@localhost mysql-4.1.13a]# CFLAGS="-03" CXX=gcc CXXFLAGS="-03 \
> -felide-constructors -fno-exceptions -fno-rtti" \
> ./configure -prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=all-static \
> --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=big5 --with-debug
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether we are using the GNU C++ compiler... no
checking whether gcc accepts -g... no
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking "C Compiler version"... "gcc gcc (GCC) 4.0.0 20041214 (Red Hat 4.0.0-0.14.EL4)"
checking "C++ compiler version"... "gcc gcc (GCC) 4.0.0 20041214 (Red Hat 4.0.0-0.14.EL4)"
checking for ranlib... ranlib
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
==========================================================

b90220208
2005-08-19, 06:27 PM
[補充]:

我是參考 tarball 文件的(位於: source 目錄 /docs/mysql.info),我不是很懂,總之我列出如下:
---------------------------------------------------------
If you are using `gcc' and don't have `libg++' or
`libstdc++' installed, you can tell `configure' to use
`gcc' as your C++ compiler:

shell> CC=gcc CXX=gcc ./configure

When you use `gcc' as your C++ compiler, it does not attempt
to link in `libg++' or `libstdc++'. This may be a good idea
to do even if you have these libraries installed, because
some versions of them have caused strange problems for MySQL
users in the past.
---------------------------------------------------------

-> 感覺上她的意思是若無 c++ compiler 者,也可告訴 ./configure 指定以 gcc 來編譯 c++'s source,且我還符合她的其他條件就是: 我系統上也無`libg++' 及 `libstdc++' ....
所以當看到錯誤訊息中有以下這行真的有點給她混亂
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

b90220208
2005-08-20, 12:46 PM
關於:
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

-> cpp 鷹該是 C 的 Preprocessor ,為何她說是 C++ 呢??

p.s 我 ls -al /lib/cpp ,發現此是一個連結檔, link 到 /usr/bin/cpp


還有,
以下是官方網站提到的一段話,不知是否與此有關??
P.S 我的 gcc 版本是 : 3.4.3-22.1

==========================================================================
Source downloads
Compiler Advisory: Several users have reported random crashes and table corruptions when using MySQL binaries compiled with gcc 2.96 on the x86 Linux platform. We suggest that you use gcc 2.95 or gcc 2.91 to compile your own binaries. It should also be safe to use gcc 3.2.

For maximum stability and performance, we recommend that you use the binaries we provide.
==========================================================================

b90220208
2005-08-20, 07:38 PM
我查過我的環境,確定有的套件就是:(GNU)
gcc-3.4.3-22.1
libgcc-3.4.3-22.1
cpp-3.4.3-22.1
make-3.80-5
autoconf-2.59-5
m4-1.4.1-16
應該沒缺什麼了...為何就是無法產生 Makefile 呢 ??? (好失望啊! 頭一次作編譯,我還看了 apache,php,mysql 等 tarball 的一堆文件才開始的. 我了自己的實力,只是不想放棄...)


以下是我的查詢結果,我自己也被搞糊塗了啊....
[root@localhost /]# rpm -qi cpp-3.4.3-22.1
Name : cpp Relocations: (not relocatable)
Version : 3.4.3 Vendor: CentOS
Release : 22.1 Build Date: 西元2005年06月10日 (週五) 04時19分30秒
Install Date: 西元2005年08月19日 (週五) 17時05分40秒 Build Host: guru.build.karan.org
Group : Development/Languages Source RPM: gcc-3.4.3-22.1.src.rpm
Size : 3599065 License: GPL
Signature : DSA/SHA1, 西元2005年06月11日 (週六) 02時53分41秒, Key ID a53d0bab443e1821
Packager : Karanbir Singh <[email protected]>
URL : http://gcc.gnu.org
Summary : The C Preprocessor.
Description :
Cpp is the GNU C-Compatible Compiler Preprocessor.
Cpp is a macro processor which is used automatically
by the C compiler to transform your program before actual
compilation. It is called a macro processor because it allows
you to define macros, abbreviations for longer
constructs.

The C preprocessor provides four separate functionalities: the
inclusion of header files (files of declarations that can be
substituted into your program); macro expansion (you can define macros,
and the C preprocessor will replace the macros with their definitions
throughout the program); conditional compilation (using special
preprocessing directives, you can include or exclude parts of the
program according to various conditions); and line control (if you use
a program to combine or rearrange source files into an intermediate
file which is then compiled, you can use line control to inform the
compiler about where each source line originated).

You should install this package if you are a C programmer and you use
macros.

b90220208
2005-08-21, 10:43 AM
可以編譯了... :D :D

我大概有點懂了,由於我的 ./configure 參數指定了以 gcc 來作為 c++ compiler,
問題就在於我目前的 gcc-3.4.3-22.1 package 尚無 c++ 的 support,所以才會一
直過不了關,直至我裝了 gcc-c++-3.4.3-22.1 package 才無此問題!.....不知我這樣想對不對??

另外請問下面這行到底是何意義??
configure: error: C++ preprocessor "/lib/cpp" fails sanity check


最後,回報:
make install 還是沒過關...
嗯,以下貼出 make install 的 stderr 與 ./configure 的參數設定:
=============================================
gcc: all-static: No such file or directory
gcc: unrecognized option `-03'
make[3]: *** [mysql_tzinfo_to_sql] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
=============================================

# CFLAGS="-03" CXX=gcc CXXFLAGS="-03 \
> -felide-constructors -fno-exceptions -fno-rtti" \
> ./configure -prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=all-static \
> --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=big5 --with-debug

會不會是與下面的這段話有關??
(因為我有安裝: libstdc++ 套件)
-----------------------------------------------------------------------
If you are using `gcc' and don't have `libg++' or
`libstdc++' installed, you can tell `configure' to use
`gcc' as your C++ compiler:

shell> CC=gcc CXX=gcc ./configure

When you use `gcc' as your C++ compiler, it does not attempt
to link in `libg++' or `libstdc++'. This may be a good idea
to do even if you have these libraries installed,because
some versions of them have caused strange problems for MySQL
users in the past.
-----------------------------------------------------------------------


還有我 configure 與 make 的時間一共花了 8,90 分鐘,這正常嗎? (跟灌 xp 有得比)