时间:2021-07-01 10:21:17 帮助过:34人阅读
检查依赖包
yum install ncurses-devel libaio-devel -y
rpm -qa ncurses-devel libaio
如果安装5.5 需要一个软件 cmake
https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz
tar xf cmake-3.6.3.tar.gz
cd cmake-3.6.3.tar.gz
./configure
gmake
gmake install
==========安装mysql===========
创建用户
useradd mysql -s /sbin/nologin -M
cd mysql-5.5.32
编译
cd mysql-5.5.32
编译
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 \
-DMYSQL_DATADIR=/application/mysql-5.5.32/data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED-LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
make && make install &
ln -s /application/mysql-5-5.32/ /application/mysql
安装完成
拷贝模板
cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf‘? y
配置环境变量
echo ‘export PATH=/application/mysql/bin:$PATH‘ >> /etc/profile
tail -1 /etc/profile
source /etc/profile
echo $PATH
/application/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
一定要排在最前面
chown -R mysql.mysql /application/mysql/data/
chmod -R 1777 /tmp/
初始化
cd /application/mysql/scripts/
./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
init.d启动脚本
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start
查看端口
netstat -lntup|grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 19011/mysqld
就能登录了
启动mysql
mysql详解安装
标签:x86_64 ack yum仓库 monitor http 服务器 partition its tar