MySQL5.7.18源码编译安装笔记【CentOS篇】

来源:互联网 发布:ajaxupload3.9.js下载 编辑:程序博客网 时间:2024/05/20 13:39

#### create_author: 蛙鳜鸡鹳狸猿# create_time  : 2017-07-19# program      : *_*install MySQL5.7.18 on CentOS7.3.1611 from source code*_*#### ①install OS relationyum install gcc-c++ cmake ncurses-devel# ②download source codewget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.18.tar.gztar -xzv -f mysql-boost-5.7.18.tar.gz# ③compile and installcd mysql-5.7.18/cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_BOOST=boostmake && make install# ④init and configgroupadd mysqluseradd -g mysql mysqlmkdir /usr/local/mysql/datachown -R mysql /usr/local/mysqlchgrp -R mysql /usr/local/mysql/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data# [Note] A temporary password is generated for root@localhost: iN+(pF+a_9kp #/usr/local/mysql/bin/mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/datamv /etc/my.cnf /etc/my.cnf.backupvim /etc/my.cnf[client]socket = /tmp/mysql.sock[mysqld]socket = /tmp/mysql.sockbasedir = /usr/local/mysqldatadir = /usr/local/mysql/data# ⑤start up servicecp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldchmod +x /etc/init.d/mysqldchkconfig --add mysqldchkconfig mysqld onservice mysqld startln -s /usr/local/mysql/bin/mysql /usr/bin/mysqlmysql -uroot -p'iN+(pF+a_9kp'mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '1024';firewall-cmd --add-port=3306/tcp --permanentsystemctl restart firewalld.servicevim /etc/my.cnf[client]user = rootpassword = 1024port = 3306socket = /tmp/mysql.sock[root@bilery mysql-5.7.18]# mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 6Server version: 5.7.18 Source distributionCopyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> UPDATE `mysql`.`user` SET `Host` = '%' WHERE `User` = 'root';Query OK, 1 row affected (0.04 sec)Rows matched: 1  Changed: 1  Warnings: 0mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)mysql> 

原创粉丝点击