MySQL安装-glibc方式安装#
版本说明:这里安装版本为MySQL-5.7系列的 mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
步骤#
下载软件包#
官网下载
# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
搜狐镜像站下载
# wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
解压软件包#
复制代码
1、解压
# tar xvf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
2、移动
# mv mysql-5.7.27-linux-glibc2.12-x86_64 /usr/local/mysql
3、验证
# ls /usr/local/mysql/
COPYING README bin docs include lib man share support-files
复制代码
编辑配置文件#
复制代码
1、编辑主配置文件
# vi /etc/my.cnf
[mysqld]
datadir=/usr/local/mysql/data/
socket=/tmp/mysql.sock
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysql