编译安装mysql5.1.73

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译安装mysql5.1.73相关的知识,希望对你有一定的参考价值。

mkdir -p /db/mysql
mkdir -p /usr/local/mysql
mkdir -p /usr/local/mysql/var
mkdir -p /usr/local/mysql/data && mkdir -p /usr/local/mysql/run && mkdir -p /usr/local/mysql/log && mkdir -p /usr/local/mysql/var
useradd -s /sbin/nologin mysql
chown -R mysql.mysql /db/mysql/
chown -R mysql.mysql /usr/local/mysql/

yum install -y gcc yum install -y gcc-c++ yum -y install ncurses yum install -y libtermcap

./configure --enable-thread-safe-client --enable-assembler --with-server-suffix =" for >>>MySQL Database of Zebra by Yhc<<<" --without-debug --with-extra-charsets=complex --prefix=/usr/local/mysql

make -j 12 && make install

#添加PATH
echo "PATH=\"/usr/local/mysql/bin:\$PATH\"" >> /etc/profile && export PATH="/usr/local/mysql/bin:$PATH"

#strip可执行文件
strip /usr/local/mysql/libexec/mysqld

#添加LIB PATH
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf && ldconfig

#将my.cnf文件cp到/etc目录下
/bin/cp -r /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf && chown mysql:mysql /etc/my.cnf
sed -i ‘s/skip-federated/#skip-federated/‘ /etc/my.cnf
cd /usr/local/mysql/bin
ln -s ./mysql ./test_mysql
ln -s ./mysqladmin ./adminmysql
ln -s ./mysql_install_db ./install_db_mysql
ln -s ./mysqld_safe ./safe_mysqld

#初始化Mysql表
cd /usr/local/mysql/bin
./install_db_mysql --user=mysql 或者 ./mysql_install_db --user=mysql --datadir=/db/mysql/

cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chown -R root /usr/local/mysql && chown -R mysql /usr/local/mysql/var && chgrp -R mysql /usr/local/mysql

以上是关于编译安装mysql5.1.73的主要内容,如果未能解决你的问题,请参考以下文章

Centos6.7 Mysql5.1.73离线安装

rpm方式安装MySQL5.1.73

MySQL安装部署02-VirtualBox虚拟机上Centos6.8安装MySQL5.1.73

SuSE11安装MySQL5.1.73:RPM安装方式(超简单入门级安装)

mysql5.1.73 Access denied for user 'root'@'localhost' (using password: YES)

centos6.8安装mysql5.6