yum -y install gcc gcc-c++ ncurses ncurses-devel bison libgcrypt perl make cmake
useradd -s /sbin/nologin -M mysql
mkdir -p /usr/local/boost cd /usr/local/boost wget https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz tar xf boost_1_59_0.tar.gz
从官网下载即可。
mkdir -p /home/deploy/mysql/{data,log,tmp} ls /home/deploy/mysql/ chown -R mysql:mysql /home/deploy/mysql/
cmake . -DCMAKE_INSTALL_PREFIX=/home/deploy/mysql \ -DMYSQL_DATADIR=/home/deploy/mysql/data \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DMYSQL_TCP_PORT=3306 \ -DMYSQL_USER=mysql \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DENABLE_DOWNLOADS=1 \ -DDOWNLOAD_BOOST=1 \ -DWITH_BOOST=/usr/local/boost然后make,再继续make install
make && make install时间比较久,大概需要两个小时
echo 'export PATH=/home/deploy/mysql/bin:$PATH' >>/etc/profile source /etc/profile
cp support-files/mysql.server /etc/init.d/mysqld chmod a+x /etc/init.d/mysqld cp packaging/rpm-common/my.cnf /etc/my.cnf
见附件。
mysqld --defaults-file=/etc/my.cnf --initialize --user='mysql' --log_error_verbosity --explicit_defaults_for_timestamp
/etc/init.d/mysqld start #密码在err_mysql.log中 grep password err_mysql.log 2019-09-12T10:35:26.035824Z 1 [Note] A temporary password is generated for root@localhost: owsLRUcc.7FL
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Tom579#$%^&';授权root远程登录
GRANT ALL PRIVILEGES ON *.* TO root@'192.168.0.%' IDENTIFIED BY '123456' WITH GRANT OPTION;刷新权限
flush privileges;
修改日期 | 修改人 | 备注 |
2020-04-13 15:15:02[当前版本] | 文艺范儿 | 格式调整 |
2020-04-13 15:10:55 | 文艺范儿 | 格式调整 |
2020-04-13 14:12:11 | 文艺范儿 | 格式调整 |
2020-04-13 13:35:23 | 文艺范儿 | 格式调整 |
附件类型 | TXT |
|
|