安装 MySQL 5.5.8
1、系统和软件环境
系统:CentOS 5.5
安装必要软件:
1 | yum -y install gcc make bison |
下载软件包:
mysql-5.5.8.tar.gz
cmake-2.8.3.tar.gz
安装cmake:
1 2 3 | tar xzvf cmake-2.8.3.tar.gz ./configure --prefix=/usr make&&make install |
2、安装mysql
1 2 3 4 5 6 7 8 | tar xzvf mysql-5.5.8.tar.gz cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/data \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_COMMENT=slevin \ -DWITH_DEBUG=OFF \ make&&make install |
3、初始化数据库
1 2 3 4 5 6 7 8 9 10 11 | cd /usr/local/mysql useradd mysql -d /dev/null -s /sbin/nologin chown -R root:mysql . /usr/local/mysql/scripts/mysql_install_db --datadir=/data --user=mysql chown -R mysql:mysql /data cat support-files/my-innodb-heavy-4G.cnf | grep -v "#" | grep -v "^$" > /etc/my.cnf echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile source /etc/profile cp support-files/mysql.server /etc/rc.d/init.d/mysqld chkconfig --add mysqld /etc/rc.d/init.d/mysqld start |
4、清除多余的用户
1 2 3 4 5 | drop user root@127.0.0.1; drop user root@localhost.localdomain; drop user ''@localhost.localdomain; drop user ''@localhost; drop user 'root'@'::1'; |
评论已关闭。