1.安装make编译器
tar zxvf make-3.82.tar.gz
cd make-3.82
./configure
make
make install
tar zxvf make-3.82.tar.gz
cd make-3.82
./configure
make
make install
2.安装bison
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install
3.安装gcc-c++
tar zxvf gcc-c++-4.4.4.tar.gz
cd gcc-c++-4.4.4
./configure
make
make install
tar zxvf gcc-c++-4.4.4.tar.gz
cd gcc-c++-4.4.4
./configure
make
make install
4.安装cmake
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install
tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install
5.安装ncurses
tar zxvf ncurses-5.8.tar.gz
cd ncurses-5.8
./configure
make
make install
tar zxvf ncurses-5.8.tar.gz
cd ncurses-5.8
./configure
make
make install
准备工作
groupadd mysql
useradd -r -g mysql mysql
groupadd mysql
useradd -r -g mysql mysql
解压并安装MySQL
tar zxvf mysql-5.6.10.tar.gz
cd mysql-5.6.10
cmake . /
make
make install
tar zxvf mysql-5.5.13.tar.gz
cd mysql-5.5.13
cmake . /
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
-DINSTALL_DATADIR=/usr/local/mysql/data
make
make install
完成后,继续下面的操作
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
下面的命令是可选的,将mysql的配置文件拷贝到/etc
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
启动mysql:
bin/mysqld_safe --user=mysql &
#启动mysql,看是否成功
netstat -tnl|grep 3306
bin/mysqld_safe --user=mysql &
#启动mysql,看是否成功
netstat -tnl|grep 3306
上面是一种启动mysql的方法,还有一种简单的方便,如下:
#将mysql的启动服务添加到系统服务中
cp support-files/mysql.server /etc/init.d/mysql.server
#现在可以使用下面的命令启动mysql
service mysql.server start
#停止mysql服务
service mysql.server stop
#重启mysql服务
service mysql.server restart