云服务器linux系统编译安装mysql5.5

蜗牛vps vps教程 2021-05-23 340 0

Author:gaojinbo
Time:2011-2-19

环境:
centos 5.5 x86_64
mysqll5.5.9

 

安装开发工具
yum groupinstall "Development Tools"

 

安装依赖包
yum install ncurses-devel

 

编译安装cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz

tar xvzf cmake-2.8.4.tar.gz
./configure
make
make install

 

 

下载

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz/from/http://mysql.mirror.tw/

 

编译安装mysql
cd mysql5.5.9
rm CMakeCache.txt
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5.9/ \
-DMYSQL_DATADIR=/usr/local/mysql5.5.9/data \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.5.9/data/mysql.sock \
-DMYSQL_USER=mysql \
-DWITH_DEBUG=0

make && make install

 

完成后进入MYSQL安装目录

cd /usr/local/mysql5.5.9
cp support-files/my-huge.cnf /etc/my.cnf
vi /etc/my.cnf

 

将数据目录和套接字文件修改为实际值.

 

修改权限
chown mysql:mysql /etc/my.cnf
chown -R mysql:mysql /usr/local/mysql5.5.9

 

切换用户进入安装目录
su – mysql
cd /usr/local/mysql5.5.9
cp scripts/mysql_install_db .
./ mysql_install_db

 

启动MYSQL
bin/mysqld_safe &

 

完成!


评论

有免费节点资源,我们会通知你!加入纸飞机订阅群

×
天气预报查看日历分享网页手机扫码留言评论Telegram