[ 79%] Built target simple-t
[ 79%] Built target skip-t
[ 79%] Built target skip_all-t
[ 80%] Built target todo-t
[ 80%] Built target basic-t
[ 80%] Built target innochecksum
[ 80%] Built target my_print_defaults
[ 81%] Built target mysql_waitpid
[ 81%] Built target perror
[ 81%] Built target replace
[ 81%] Built target resolve_stack_dump
[ 81%] Built target resolveip
[ 82%] Built target mysql
[ 82%] Built target mysql_config_editor
[ 82%] Built target mysql_plugin
[ 83%] Built target comp_sql
[ 83%] Built target GenFixPrivs
[ 83%] Built target mysql_upgrade
[ 83%] Built target mysqladmin
[ 83%] Built target mysqlbinlog
[ 83%] Built target mysqlcheck
[ 83%] Built target mysqldump
[ 83%] Built target mysqlimport
[ 83%] Built target mysqlshow
[ 83%] Built target mysqlslap
[ 83%] Built target mysqltest
[ 84%] Built target bug25714
[ 84%] Built target mysql_client_test
[ 84%] Built target mysql_tzinfo_to_sql
[ 84%] Built target mysqld
[ 84%] Built target partition_embedded
[ 84%] Built target sqlgunitlib
[ 84%] Built target udf_example
[ 99%] Built target sql_embedded
[100%] Built target mysqlserver
[100%] Built target mysql_client_test_embedded
[100%] Built target mysql_embedded
[100%] Built target mysqltest_embedded
[100%] Built target my_safe_process
..... 安装日志省略,可附件下载
4. 安装后配置,包括CentOS 7服务配置
//添加服务用户
useradd -r -M -s /sbin/nologin mysql
//更改mysql安装目录属主 属组
cd /usr/local/mysql5.6/
chown -R mysql:mysql /usr/local/mysql5.6/
//创建
//配置my.cnf,从源码包中复制my.cnf文件
cd /usr/local/mysql5.6
cp my.cnf /etc/
//根据配置文件 配置各log sock pid目录的属主 属组
chown mysql:mysql ****** (省略)
//初始化数据库
cd /usr/local/mysql5.6/
scripts/mysql_install_db --user=mysql
//配置环境变量,把mysql/bin目录添加到PATH变量中
echo 'export PATH=$PATH:/usr/local/mysql5.6/bin' >> /etc/profile && source /etc/profile
//试运行
mysqld_safe
//如果运行无报错的话,使用mysql客户端程序连接
mysql --protocol=tcp -h localhost -u root
//配置CentOS 7上的mysqld服务文件
cd /root/mysql-5.6.31/packaging/rpm-fedora/
cp mysqld.service /usr/lib/systemd/system
systemctl list-unit-files -t service | grep mysql
cd /etc/systemd/system/multi-user.target.wants/
ln -s /usr/lib/systemd/system/mysqld.service ./
//更改mysqld.service 默认配置
//可以把mysqld.service中的 ExecStartPre 和 ExecStartPost注释掉
//更改 ExecStart 项配置,路径必须为绝对路径,ExecStart=/usr/local/mysql5.6/bin/mysqld_safe
//测试mysqld.service 是否能够正常启动、重启、停止服务
systemctl daemon-reload
systemctl start mysqld.service
5. my.cnf配置举例
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
host=localhost
user=root
protocol=socket
socket=/var/lib/mysql/mysql.sock
6. mysqld.service配置举例
#
# Simple MySQL systemd service file
#
# systemd supports lots of fancy features, look here (and linked docs) for a full list:
# http://www.freedesktop.org/software/systemd/man/systemd.exec.html
#
# Note: this file ( /usr/lib/systemd/system/mysqld.service )
# will be overwritten on package upgrade, please copy the file to
#
# /etc/systemd/system/mysqld.service
#
# to make needed changes.
#
# systemd-delta can be used to check differences between the two mysqld.service files.
#
[Unit]
Description=MySQL Community Server
After=network.target
After=syslog.target