1、安装linux一些必须的包:
yum install -c++ -g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* libevent
2、安装mysql,mysql安装包需要自己下载,安装目录 /usr/local/web/
sudo mkdir -p /usr/local/web/
sudo tar xzvf mysql-5.1.39.tar.gz
cd mysql-5.1.39
./configure --prefix=/usr/local/web/mysql.5.1.39 --enable-thread-safe-client --enable-assembler --with-big-tables --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci plex
make
make install
3、创建mysql用户组等信息
sudo groupadd mysql
sudo useradd -g mysql -s /sbin/nologin mysql
sudo ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/web/mysql.5.1.39/var
sudo chown -R root /usr/local/web/mysql.5.1.39
sudo chown -R mysql:mysql /usr/local/web/mysql.5.1.39/var
4、管理MYSQL
#启动mysql:
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server start
#重启mysql
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server restart
#停止mysql
sudo /usr/local/web/mysql.5.1.39/share/mysql/mysql.server
linux