mac 安装mysql5.6.36_源码安装MySQL5.6.36

#mysql5.6.36部署过程

#安装依赖

yum install -y gcc gcc-c++ automake autoconf git make

yum -y install cmake bison-devel ncurses-devel libaio-devel

#下载

#wget https://downloads.mysql.com/archives/get/file/mysql-5.6.36.tar.gz

chmod 1777 /tmp

#预编译

cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.36 \

-DMYSQL_DATADIR=/application/mysql-5.6.36/data \

-DMYSQL_UNIX_ADDR=/application/mysql-5.6.36/tmp/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_FEDERATED_STORAGE_ENGINE=1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \

-DWITH_ZLIB=bundled \

-DWITH_SSL=bundled \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_EMBEDDED_SERVER=1 \

-DENABLE_DOWNLOADS=1 \

-DWITH_DEBUG=0

#编译 && 安装

make && make install

#安装后操作

useradd -s /sbin/nologin mysql -M

ln -s /application/mysql-5.6.36 /application/mysql

chown -R mysql.mysql /application/mysql/data

/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data

/bin/cp /application/mysql/support-files/my-default.cnf /etc/my.cnf

/bin/cp /application/mysql/support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

echo 'export PATH=/application/mysql/bin:$PATH' >> /etc/profile

. /etc/profile

#启动

/etc/init.d/mysqld start

#启动错误

#Starting MySQL.Logging to '/application/mysql-5.6.36/data/db01.err'.

#171113 13:07:01 mysqld_safe Directory '/application/mysql-5.6.36/tmp' for UNIX socket file don't exists.

# ERROR! The server quit without updating PID file (/application/mysql-5.6.36/data/db01.pid).

#这个错误源于这个配置

#-DMYSQL_UNIX_ADDR=/application/mysql-5.6.36/tmp/mysql.sock

#解决

mkdir /application/mysql-5.6.36/tmp

chown -R mysql.mysql /application/mysql-5.6.36/tmp

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值