Mysql5.6二进制包安装方法

时间:2022-01-22 20:58:43

1.Download MySQL Community Server

访问mysql官方网站转到下载页https://dev.mysql.com/downloads/mysql/5.6.html#downloads

选择mysql-community-5.6版本

Mysql5.6二进制包安装方法

2.解压安装包

tar zxvf mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz mv mysql-5.6.43-linux-glibc2.12-x86_64 /usr/local/mysql

3.创建用户组,授权

useradd mysql -s /sbin/nologin –M chown -R mysql:mysql /usr/local/mysql/

4.初始化数据库

cd /usr/local/mysql/scripts&&./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

5.启动数据库

cd /usr/local/mysql/support-files&&./mysql.server start

6.更改root密码

cd /usr/local/mysql/bin&&./mysqladmin -uroot -p password