MySQL的configure详解

configure’ configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]… [VAR=VALUE]…

To assign environment variables (e.g., CC, CFLAGS…), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
-h, –help              display this help and exit
–help=short        display options specific to this package
–help=recursive    display the short help of all the included packages
-V, –version           display version information and exit
-q, –quiet, –silent   do not print `checking…’ messages
–cache-file=FILE   cache test results in FILE [disabled]
-C, –config-cache      alias for `–cache-file=config.cache’
-n, –no-create         do not create output files
–srcdir=DIR        find the sources in DIR [configure dir or `..’]

Installation directories:
–prefix=PREFIX         install architecture-independent files in PREFIX
[/usr/local]
–exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
[PREFIX]

By default, `make install’ will install all the files in
`/usr/local/bin’, `/usr/local/lib’ etc.  You can specify
an installation prefix other than `/usr/local’ using `–prefix’,
for instance `–prefix=$HOME’.

For better control, use the options below.

Fine tuning of the installation directories:
–bindir=DIR            user executables [EPREFIX/bin]
–sbindir=DIR           system admin executables [EPREFIX/sbin]
–libexecdir=DIR        program executables [EPREFIX/libexec]
–sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
–sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
–localstatedir=DIR     modifiable single-machine data [PREFIX/var]
–libdir=DIR            object code libraries [EPREFIX/lib]
–includedir=DIR        C header files [PREFIX/include]
–oldincludedir=DIR     C header files for non-gcc [/usr/include]
–datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
–datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
–infodir=DIR           info documentation [DATAROOTDIR/info]
–localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
–mandir=DIR            man documentation [DATAROOTDIR/man]
–docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
–htmldir=DIR           html documentation [DOCDIR]
–dvidir=DIR            dvi documentation [DOCDIR]
–pdfdir=DIR            pdf documentation [DOCDIR]
–psdir=DIR             ps documentation [DOCDIR]

Program names:
–program-prefix=PREFIX            prepend PREFIX to installed program names
–program-suffix=SUFFIX            append SUFFIX to installed program names
–program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
–build=BUILD     configure for building on BUILD [guessed]
–host=HOST       cross-compile to build programs to run on HOST [BUILD]
–target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features:
–disable-option-checking  ignore unrecognized –enable/–with options
–disable-FEATURE       do not include FEATURE (same as –enable-FEATURE=no)
–enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
–disable-dependency-tracking  speeds up one-time build
–enable-dependency-tracking   do not reject slow dependency extractors
–enable-shared[=PKGS]  build shared libraries [default=yes]
–enable-static[=PKGS]  build static libraries [default=yes]
–enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
–disable-libtool-lock  avoid locking (might break parallel builds)
–disable-community-features
Disable additional features provided by the user
community.
–disable-thread-safe-client
Compile the client without threads.
–enable-assembler      Use assembler versions of some string
functions if available.
–enable-profiling      Build a version with query profiling code (req.
community-features)
–enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)
–disable-grant-options Disables the use of –init-file, –skip-grant-tables and –bootstrap options
–disable-largefile     Omit support for large files

Optional Packages:
–with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
–without-PACKAGE       do not use PACKAGE (same as –with-PACKAGE=no)
–with-charset=CHARSET
Default character set, use one of:
binary
armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
greek hebrew hp8 keybcs2 koi8r koi8u
latin1 latin2 latin5 latin7 macce macroman
sjis swe7 tis620 ucs2 ujis utf8
–with-collation=COLLATION
Default collation
–with-extra-charsets=CHARSET,CHARSET,…
Use charsets in addition to default (none, complex,
all, or a list selected from the above sets)
–without-uca           Skip building of the national Unicode collations.

–with-system-type      Set the system type, like “sun-solaris10”
–with-machine-type     Set the machine type, like “powerpc”
–with-darwin-mwcc      Use Metrowerks CodeWarrior wrappers on OS X/Darwin
–with-gnu-ld           assume the C compiler uses GNU ld [default=no]
–with-pic              try to use only PIC/non-PIC objects [default=use
both]
–with-tags[=TAGS]      include additional configurations [automatic]
–with-other-libc=DIR   Link against libc and other standard libraries
installed in the specified non-standard location
overriding default. Originally added to be able to
link against glibc 2.2 without making the user
upgrade the standard libc installation.
–with-server-suffix    Append value to the version string.
–with-pthread          Force use of pthread library.
–with-named-thread-libs=ARG
Use specified thread libraries instead of
those automatically found by configure.
–with-named-curses-libs=ARG
Use specified curses libraries instead of
those automatically found by configure.
–with-unix-socket-path=SOCKET
Where to put the unix-domain socket.  SOCKET must be
an absolute file name.
–with-tcp-port=port-number
Which port to use for MySQL services (default 3306)
–with-mysqld-user=username
What user the mysqld daemon shall be run as.
–with-zlib-dir=no|bundled|DIR
Provide MySQL with a custom location of compression
library. Given DIR, zlib binary is assumed to be in
$DIR/lib and header files in $DIR/include.
–with-libwrap=DIR      Compile in libwrap (tcp_wrappers) support
–with-pstack           Use the pstack backtrace library
–with-debug            Add debug code
–with-debug=full       Add debug code (adds memory checker, very slow)
–with-error-inject     Enable error injection in MySQL Server
–with-fast-mutexes     Compile with fast mutexes (default is disabled)
–with-atomic-ops=rwlocks|smp|up
Implement atomic operations using pthread rwlocks or
atomic CPU instructions for multi-processor
(default) or uniprocessor configuration
–with-mysqld-ldflags   Extra linking arguments for mysqld
–with-client-ldflags   Extra linking arguments for clients
–with-mysqld-libs   Extra libraries to link with for mysqld
–with-lib-ccflags      Extra CC options for libraries
–with-low-memory       Try to use less memory to compile to avoid
memory limitations.
–with-comment          Comment about compilation environment.
–with-big-tables       Support tables with more than 4 G rows even on 32
bit platforms
–with-max-indexes=N    Sets the maximum number of indexes per table,
default 64
–with-ssl=DIR    Include SSL support
–with-plugins=PLUGIN[[[,PLUGIN..]]]
Plugins to include in mysqld. (default is: none)
Must be a configuration name or a comma separated
list of plugins.
Available configurations are: none max max-no-ndb
all.
Available plugins are: partition daemon_example
ftexample archive blackhole csv example federated
heap innobase myisam myisammrg ndbcluster.
–without-plugin-PLUGIN Disable the named plugin from being built.
Otherwise, for plugins which are not selected for
inclusion in mysqld will be built dynamically (if
supported)
–with-plugin-PLUGIN    Forces the named plugin to be linked into mysqld
statically.
–with-ndb-sci=DIR      Provide MySQL with a custom location of sci library.
Given DIR, sci library is assumed to be in $DIR/lib
and header files in $DIR/include.

–with-ndb-test       Include the NDB Cluster ndbapi test programs

–with-ndb-docs       Include the NDB Cluster ndbapi and mgmapi documentation

–with-ndb-port       Port for NDB Cluster management server

–with-ndb-port-base  Base port for NDB Cluster transporters

–without-ndb-debug   Disable special ndb debug features
–with-ndb-ccflags=CFLAGS
Extra CFLAGS for ndb compile

–without-ndb-binlog       Disable ndb binlog
–without-server        Only build the client.
–with-embedded-server  Build the embedded server (libmysqld).
–without-query-cache   Do not build query cache.
–without-geometry      Do not build geometry-related parts.
–with-embedded-privilege-control
Build parts to check user’s privileges.
Only affects embedded library.
–with-mysqlmanager     Build the mysqlmanager binary: yes/no (default:
build if server is built.)
–without-docs          Skip building of the documentation.
–without-man          Skip building of the man pages.
–without-readline      Use system readline instead of bundled copy.
–without-libedit       Use system libedit instead of bundled copy.

Some influential environment variables:
CC          C compiler command
CFLAGS      C compiler flags
LDFLAGS     linker flags, e.g. -L if you have libraries in a
nonstandard directory    LIBS        libraries to pass to the linker, e.g. -l   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I if
you have headers in a nonstandard directory    CXX         C++ compiler command   CXXFLAGS    C++ compiler flags   CPP         C preprocessor   CXXCPP      C++ preprocessor   F77         Fortran 77 compiler command   FFLAGS      Fortran 77 compiler flags   CCAS        assembler compiler command (defaults to CC)   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)  Use these variables to override the choices made by `configure’ or to help it to find libraries and programs with nonstandard names/locations.  Description of plugins:     === Partition Support ===   Plugin Name:      partition   Description:      MySQL Partitioning Support   Supports build:   static   Configurations:   max, max-no-ndb     === Daemon Example Plugin ===   Plugin Name:      daemon_example   Description:      This is an example plugin daemon.   Supports build:   dynamic     === Simple Parser ===   Plugin Name:      ftexample   Description:      Simple full-text parser plugin   Supports build:   dynamic     === Archive Storage Engine ===   Plugin Name:      archive   Description:      Archive Storage Engine   Supports build:   static and dynamic   Configurations:   max, max-no-ndb     === Blackhole Storage Engine ===   Plugin Name:      blackhole   Description:      Basic Write-only Read-never tables   Supports build:   static and dynamic   Configurations:   max, max-no-ndb     === CSV Storage Engine ===   Plugin Name:      csv   Description:      Stores tables in text CSV format   Supports build:   static   Status:           mandatory     === Example Storage Engine ===   Plugin Name:      example   Description:      Example for Storage Engines for developers   Supports build:   dynamic   Configurations:   max, max-no-ndb     === Federated Storage Engine ===   Plugin Name:      federated   Description:      Connects to tables on remote MySQL servers   Supports build:   static and dynamic   Configurations:   max, max-no-ndb     === Memory Storage Engine ===   Plugin Name:      heap   Description:      Volatile memory based tables   Supports build:   static   Status:           mandatory     === InnoDB Storage Engine ===   Plugin Name:      innobase   Description:      Transactional Tables using InnoDB   Supports build:   static and dynamic   Configurations:   max, max-no-ndb     === MyISAM Storage Engine ===   Plugin Name:      myisam   Description:      Traditional non-transactional MySQL tables   Supports build:   static   Status:           mandatory     === MyISAM MERGE Engine ===   Plugin Name:      myisammrg   Description:      Merge multiple MySQL tables into one   Supports build:   static   Status:           mandatory     === Cluster Storage Engine ===   Plugin Name:      ndbcluster   Description:      High Availability Clustered tables   Supports build:   static   Configurations:   max

linux开机启动服务和chkconfig使用方法

  1. 服务概述
    在linux操作系统下,经常需要创建一些服务,这些服务被做成shell脚本,这些服务需要在系统启动的时候自动启动,关闭的时候自动关闭。
    将需要自动启动的脚本/etc/rc.d/init.d目录下,然后用命令chkconfig –add filename将自动注册开机启动和关机关闭。实质就是在rc0.d-rc6.d目录下生成一些文件连接,这些连接连接到/etc/rc.d /init.d目录下指定文件的shell脚本。
  2. 手工创建服务
    在/etc/rc.d/init.d目录下创建shell脚本,文件名auto_run。
    设置脚本的运行权限chmod +x auto_run。
    然后在rc0.d-rc6.d目录下分别创建文件连接。
    ln -s /etc/rc.d/init.d/auto_run /etc/rc.d/rc2.d/S99auto_run
    ln -s /etc/rc.d/init.d/auto_run /etc/rc.d/rc3.d/S99auto_run
    ln -s /etc/rc.d/init.d/auto_run /etc/rc.d/rc5.d/S99auto_run
    ln -s /etc/rc.d/init.d/auto_run /etc/rc.d/rc0.d/K01auto_run
    ln -s /etc/rc.d/init.d/auto_run /etc/rc.d/rc6.d/K01auto_run
    这样系统在启动的时候,就会运行auto_run 并加上start参数,等同于执行命令auto_run start。
    在系统关闭的时候,就会运行auto_run,并加上stop参数,等同于运行命令auto_run stop。
    创建连接的6条命令可以用命令chkconfig –add auto_run来完成,这样就简单多了,还不容易出错。
    下面就介绍一下chkconfig命令。
  3. chkconfig命令用法
    语法:
    chkconfig –list [name]
    chkconfig –add name
    chkconfig –del name
    chkconfig [–level levels] name <on|off|reset>
    chkconfig [–level levels] name
    说明:
    chkconfig提供一种简单的命令行工具来帮助管理员对/etc/rc[0-6].d目录层次下的众多的符号链接进行直接操作。
    此命令使用是由chkconfig命令在IRIX操作系统提供授权。不用在/etc/rc[0-6].d目录下直接维护配置信息,而是直接在/etc/rc[0-6]下管理链接文件。在运行级别的目录下的配置信息通知在将会初始启动哪些服务。
    Chkconfig有五个很明确的功能:为管理增加一个新的功能、删除一个功能、列出当前服务的启动信息、改变一个服务的启动信息和检测特殊服务的启动状态。
    当chkconfig没有参数运行时,它将显示其使用方法。如果只给出了一个服务名,它将检测这个服务名是否已经被配置到了当前运行级别中。如果已经配置,返回真,否则返回假。–level选项可以被用做查询多个运行级别而不仅仅是一个。
    如果在服务名之后指定了on,、off或reset,chkconfig将改变指定服务的启动信息。On或off标记服务被打开或停止,尤其是在运行级别被改变时。Reset标记重置服务的启动信息。
    默认情况下,on或off选项仅对2、3、4、5有影响,而 reset影响所有的运行级。–level选项可以被用于指定哪个运行级别接收影响。
    注意:对于每个服务,每一个运行级都有一个开始角本和一个结束角本。当开或关一个运行级时,init不会重新开始一个已经运行的服务,也不会重新停止一个未运行的服务。
    选项:
    –level levels
    指定一个运行级别适合的操作。范围为0-7。
    –add name
    增加一个新的服务。
    –del name
    删除一个服务
    –list name
    显示服务的情况
    RUNLEVEL FILES
    每个通过chkconfig管理的服务在其init.d目录下的角本中都需要两行或多行的注释。第一行告诉chkconfig在默认情况下什么运行级别的 服务可以开始,也就是所说的开始或结束的优先级别。如果服务没有默认的级别,建造将在所有运行级别中启动。a – 将用于代替运行级列表。第二个注释行包括对此服务的描述,可以通过反斜线符号扩展为多行。

    示例,auto_run的前三行如下:
    #!/bin/sh
    #chkconfig: 2345 80 90
    #description:auto_run
    第一行,告诉系统使用的shell,所以的shell脚本都是这样。
    第二行,chkconfig后面有三个参数2345,80和90告诉chkconfig程序,需要在rc2.d~rc5.d目录下,创建名字为 S80auto_run的文件连接,连接到/etc/rc.d/init.d目录下的的auto_run脚本。第一个字符是S,系统在启动的时候,运行脚 本auto_run,就会添加一个start参数,告诉脚本,现在是启动模式。同时在rc0.d和rc6.d目录下,创建名字为K90auto_run的 文件连接,第一个字符为K,个系统在关闭系统的时候,会运行auto_run,添加一个stop,告诉脚本,现在是关闭模式。
    注意上面的三行是中,地二,第三行是必须的,否则在运行chkconfig –add auto_run时,会报错。

  4. 常见的错误
    “服务不支持 chkconfig”:
    请注意检查脚本的前面,是否有完整的两行:
    #chkconfig: 2345 80 90
    #description:auto_run
    在脚本前面这两行是不能少的,否则不能chkconfig命令会报错误。
    如果运行chkconfig老是报错,如果脚本没有问题,我建议,直接在rc0.d~rc6.d下面创建到脚本的文件连接来解决,原理都是一样的。

来源于网络

Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.

090517 13:34:15 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
090517 13:34:15 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
090517 13:34:15 mysqld_safe mysqld from pid file /usr/local/mysql/var/mail.bmitwap.com.pid ended
090517 13:38:35 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var

解决办法 在运行初始化权限表的时候使用增加参数–datadir ,命令格式为:
shell> …./mysql_install_db –user=mysql –datadir=/usr/local/mysql/var
这样问题就解决了。