mysql5.6官网下载地址
https://downloads.mysql.com/archives/community/
二进制文件一般是tar.gz文件
安装脚本
$> groupadd mysql
$> useradd -r -g mysql -s /bin/false mysql
$> cd /usr/local
$> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
$> ln -s full-path-to-mysql-VERSION-OS mysql
$> cd mysql
建议直接将系统自带的my.cnf文件注释或删除,也可将里面存在的文件路径改成已存在路径
$> scripts/mysql_install_db --user=mysql
$> bin/mysqld_safe --user=mysql &
# Next command is optional
$> cp support-files/mysql.server /etc/init.d/mysql.server
环境变量
将以下内容写进系统环境变量
export PATH=$PATH:/usr/local/mysql/bin
设置初始root密码
/usr/local/mysql/bin/mysqladmin -u root password '$newpasswd'
设置root用户外部访问权限
grant all privileges on *.* to 'root'@'$ipaddress' identified by '$newpasswd' with grant option;
配置或关闭系统防火墙
我这里直接将firewalld关闭
systemctl stop firewalld
外部工具测试连接
至此,centos 7.6下二进制文件安装mysql5.6完成。