在linux下安装mysql服务器

1. cd /opt/soft
2. 安装 make
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar zxvf make-3.82.tar.gz 
cd make-3.82
./configure 
make
make install
cd ..

3. 安装 bison
wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure 
make
make install
cd ..

3. 安装libstdc++.so.6
yum install libstdc++.so.6

4. yum install gcc

5. 安装cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz
tar zxvf cmake-2.8.11.2.tar.gz 
cd cmake-2.8.11.2
./configure 
make 
make install
cd ..

6. 安装 ncurses
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.8.tar.gz
tar zxvf ncurses-5.8.tar.gz 
cd ncurses-5.8
./configure 
make
make install  
cd .. 

7. 安装mysql
wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.34.tar.gz
groupadd mysql
useradd -r -g mysql mysql
tar zxvf mysql-5.5.34.tar.gz 
cd mysql-5.5.34
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 .
#注意备份my.cnf
cp support-files/my-medium.cnf /etc/my.cnf  
scripts/mysql_install_db --user=mysql

修改root密码
./bin/mysql_secure_installation 


如果启动出错
'./mysql-bin.index' not found (Errcode: 13) 的解决方法
 
/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
020101  0:42:21 [ERROR] Aborting
020101  0:42:21 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,可能是上次转移数据库的时候不小心修改了文件夹的权限。
解决方法:
chgrp -R mysql /usr/local/mysql/data && chown -R mysql /usr/local/mysql/data 
重新启动mysql  [OK]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值