标签:存储引擎 base glibc 命令 show 加载 efi ddr sql
编译安装mysql-5.6.40
环境说明
系统版本 ????CentOS 7.2 x86_64
软件版本 ????mysql-5.6.40
[root@db01 ~]# mkdir -p /service/tools
[root@db01 ~]# mkdir /application
[root@db01 ~]# yum install ncurses-devel libaio-devel cmake gcc gcc-c++ glibc openssl-devel bison-devel -y
[root@db01 ~]# useradd -s /sbin/nologin -M mysql
[root@db01 ~]# cd /service/tools/
[root@db01 tools]# wget https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.6/mysql-5.6.40.tar.gz
[root@db01 tools]# tar xf mysql-5.6.40.tar.gz
[root@db01 tools]# cd mysql-5.6.40/
[root@db01 tools]# cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.40
-DMYSQL_DATADIR=/application/mysql-5.6.40/data
-DMYSQL_UNIX_ADDR=/application/mysql-5.6.40/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
参数说明:
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.40 \????#指定安装目录
-DMYSQL_DATADIR=/application/mysql-5.6.40/data \????????#指定数据data目录
-DMYSQL_UNIX_ADDR=/application/mysql-5.6.40/mysql.sock \ #指定sock路径
-DDEFAULT_CHARSET=utf8 \????????????????????????????????????#指定默认字符集
-DDEFAULT_COLLATION=utf8_general_ci \????????????????????#指定默认校验规则
-DWITH_EXTRA_CHARSETS=all \????????????????????????????????#指定扩展支持的字符集
-DWITH_INNOBASE_STORAGE_ENGINE=1 \????????????????????????#启用innodb存储引擎
-DWITH_FEDERATED_STORAGE_ENGINE=1 \????????????????????????#启用Federated存储引擎
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \????????????????????????#启用BLACKHOLE引擎
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \????????????????????????#禁用EXAMPLE_STORAGE_ENGINE
-DWITH_ZLIB=bundled \????????????????????????????????????????#启用zlib支持
-DWITH_SSL=bundled \????????????????????????????????????????#启用ssl库支持
-DENABLED_LOCAL_INFILE=1 \????????????????????????????????#启用加载本地数据
-DWITH_EMBEDDED_SERVER=1 \????????????????????????????????#嵌入式服务器
-DENABLE_DOWNLOADS=1 \????????????????????????????????????#编译时允许自主下载相关文件
-DWITH_DEBUG=0????????????????????????????????????????????????#禁用调试模式
[root@db01 tools]# make && make install
[root@db01 mysql-5.6.40]# ln -s /application/mysql-5.6.40/ /application/mysql????#创建软链接
[root@db01 mysql-5.6.40]# \cp support-files/my*.cnf /etc/my.cnf????#拷贝配置文件
[root@db01 mysql-5.6.40]# /application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data --user=mysql????????????????????????????????????#初始化
[root@db01 mysql-5.6.40]# chown -R mysql:mysql /application/mysql/????#修改目录所属
[root@db01 mysql-5.6.40]# \cp support-files/mysql.server /etc/init.d/mysqld????#拷贝启动脚本
[root@db01 mysql-5.6.40]# chmod +x /etc/init.d/mysqld????????????????#添加执行权限
[root@db01 mysql-5.6.40]# ll /etc/init.d/mysqld????????????????????????#检查
-rwxr-xr-x 1 root root 10619 7月 1 16:06 /etc/init.d/mysqld
[root@db01 mysql-5.6.40]# /etc/init.d/mysqld start????????????????????#启动mysql
Starting MySQL.Logging to ‘/application/mysql-5.6.40/data/db01.err‘.
SUCCESS!
[root@db01 mysql-5.6.40]# ln -s /application/mysql/bin/* /usr/bin/ #创建命令快捷方式
或者
[root@db01 ~]# echo ‘PATH=/application/mysql/bin/:$PATH‘ >>/etc/profile
[root@db01 ~]# tail -1 /etc/profile
[root@db01 ~]# source /etc/profile
?
基本优化(清理用户及无用数据库)
mysql> select user,host from mysql.user;
mysql> drop user ‘‘@‘db01‘;
mysql> drop user ‘‘@‘localhost‘;
mysql> drop user ‘root‘@‘db01‘;
mysql> drop user ‘root‘@‘::1‘;
mysql> select user,host from mysql.user;
mysql> drop database test;
mysql> show databases;
或者根据mysql_secure_installation命令进行向导优化
标签:存储引擎 base glibc 命令 show 加载 efi ddr sql
原文地址:https://www.cnblogs.com/ssgeek/p/10489078.html