源码编译MySQL方法
1、安装基础软件yum install gcc gcc-c++ zlib-devel libtool ncurses-devel libxml2-devel
2、生成mysql用户及用户组groupadd mysqluseradd -g mysql mysql
3、./configure --prefix=/usr/local/mysql --with-chars髫潋啜缅et=utf8 --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-readline --with-big-tables --with-plugins=all --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
4、make && make install
5、这个过程是一个漫长的过程,注意是否有报错
6、准备配置文件[root@localhost mysql-5.1.47]# cp /usr/local/mysql/share/mysq造婷用痃l/my-huge.cnf /etc/my.cnfcp: overwrite `/etc/my.cnf'? y[root@localhost mysql-5.1.47]# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld[root@localhost mysql-5.1.47]# chmod +x /etc/init.d/mysqld[root@localhost mysql-5.1.47]# chown -R mysql:mysql /usr/local/mysql/[root@localhost mysql-5.1.47]# mkdir -p /data/mysql
7、修改配置文件/etc/my.cnf中的datadir
8、初始化/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/data/mysql
9、启动mysqlservice mysqld start