64bitのcentos6.5にcmakeでmysql5.5をコンパイル、インストールする手順
1.システム情報の確認
cat /etc/system-release
uname -a
2.ユーザmysqlを作成
useradd -M -s /sbin/nologin mysql
grep mysql /etc/passwd
cat /etc/passwd |grep mysql
grep mysql /etc/group
3.mysql-5.5.39.tar.gzをダウロード
yum -y install gcc gcc-c++ cmake ncurses-devel libtool zilib-devel
tar -xvf mysql-5.5.39.tar.gz
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
./configure
make
make install
4.mysqlの所属ユーザとグループを修正
chown mysql:mysql -R /usr/local/mysql/
5.下記コマンドを実行
./scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data
ll scripts/mysql_install_db
chmod a+x ./scripts/mysql_install_db
./scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data
cp support-files/my-medium.cnf /etc/my.cnf
cat /etc/my.cnf |grep -v ^#|grep -v ^$
6.cp support-files/mysql.server /etc/init.d/mysqld
chmod a+x /etc/init.d/mysqld
起動
/etc/init.d/mysqld start
ps aux |grep mysqld
netstat -tunlp |grep 3306
echo $PATH
echo PATH=$PATH:/usr/local/mysql/bin >>/etc/profile
source /etc/profile
mysql -u root -p