我的LINUX机器: Linux 2.6.20-2925.9.fc7xen  i686 i686 i386 GNU/Linux
内存: 1G
硬盘:120G
MYSQL版本:  mysql-6.0.0-alpha.tar.gz      shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> mkdir /usr/local/mysql
     shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
     shell> cd mysql-VERSION 
 ###    shell> ./configure --prefix=/usr/local/mysql###下面的选项对数据库的性能有提高作用,优先用下面的选项
 shell> CFLAGS="-O6 -mpentiumpro -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql
--enable-assembler -with-extra-charsets=none --with-mysqld-ldflags=-all-static --disable-shared
 
     shell> make
     shell> make install
     shell> cp support-files/my-huge.cnf      /etc/my.cnf
     shell> cd /usr/local/mysql
 
    查看文件中有没有设置本地域名,没有则添加
     shell> vi /etc/hosts    
        add  127.0.0.1   localhost.localdomain   localhost
       保存
 
     shell> bin/mysql_install_db --user=mysql
     shell> chown -R root  .
     shell> chown -R mysql var
     shell> chgrp -R mysql .
     shell> bin/mysqld_safe --user=mysql &              //开启MYSQL服务
      
## 设置用户和密码
mysql>      GRANT all ON *.* TO root@"%" IDENTIFIED BY 'root';
####################################################################
以下命令用于设置mysql开机自动运行
cd mysql-VERSION    
####再次进入解压后的目录,即源码目录。
cp support-files/mysql.server /etc/init.d/mysql
###将mysql.server这个文件copy到/etc/init.d/目录下,并更名为mysql
chmod 755 /etc/init.d/mysql
###给/etc/init.d/mysql这个文件赋予“执行”权限
chkconfig --level 345 mysql on
###加入到开机自动运行,运行级别为3 4 5
service mysql restart     
###重启mysql服务   ##{start | stop | restart | reload}
##########################################################################可根据我的优化方法修改/etc/my.cnf (参见配置方法)
修改完成后运行下面的命令
# service mysql restart
     问题1:   
error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
问题就是编译机mysql的路径与运行机不一样(或者没有)造成[解决方法]
MYSQL 安装在/usr/local/mysql目录下。安装完成后,要把/usr/local/mysql/lib/mysql的库路径加到/etc/ld.so.conf文件内,
# echo "/usr/local/mysql/lib/mysql"  >>  /etc/ld.so.conf
添加完成后执行一次   ldconfig,使用配置文件生效。
#   ldconfig  -v
这样编译openldap时才能找到相应的库文件。这样资料库就安装完成了,接下来可以安装openldap了。
                问题2: 
Access denied for user 'root'@'localhost' (using password: NO)
数据库访问的用户名或密码不对                问题3:
 如果编译时出现:undefined reference to `compress'
[解决方法]
 则在MYSQL库路径加入 增加-lz参数
$(MYSQL_LIB) -lmysqlclient  $(MYSQL_LIB) -lmysqlclient_r -lm -lz