Linux CentOS7 安装 Mysql5.7.19

1.解压文件

[[email protected] ~]# tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local/

2.重命名

[[email protected] ~]# cd /usr/local/

[[email protected] local]# mv mysql-5.7.19-linux-glibc2.12-x86_64/ mysql

3.配置环境变量

[[email protected]  local]# vi + /etc/profile

[[email protected]  local]# source  /etc/profile

4.创建组和用户并授权

[[email protected] local]# groupadd mysql

[[email protected] local]# useradd -r -g mysql -s /bin/false mysql

[[email protected] local]# chown -R mysql mysql/
[[email protected] local]# chgrp -R mysql mysql/

5.初始化并记住最后的12位密码

[[email protected] local]#  /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --lc_messages_dir=/usr/local/mysql/share --lc_messages=zh_CN

6.修改mysql.server.文件并复制到 /etc/init.d/目录下

[[email protected] local]# cd /usr/local/mysql/support-files/
[[email protected] support-files]# vi mysql.server

[[email protected] support-files]# cp mysql.server /etc/init.d/mysqld

7.重命名my.cnf

[[email protected] support-files]# mv /etc/my.cnf /etc/my_default.cnf

8.设置开机启动

[[email protected] support-files]# chmod +x /etc/init.d/mysqld
[[email protected] support-files]# chkconfig --add mysqld
[[email protected] support-files]# chkconfig mysqld on

//查看开机启动是否成功

[[email protected] support-files]# chkconfig --list mysqld

9.启动服务

[[email protected] support-files]# /etc/init.d/mysqld start
[[email protected] support-files]# service mysql start

10.登录修改密码,密码就是第5步系统生成的

[[email protected] support-files]# mysql -uroot -p

mysql> set password=password("1234");

时间: 2024-11-09 16:22:47

Linux CentOS7 安装 Mysql5.7.19的相关文章

Linux Centos7安装MySQL5.5(二进制方式安装)

Linux Centos7安装MySQL5.5(二进制方式安装)一.在/app目录下下载mysql-5.5.54-linux2.6-x86_64.tar.gz`[[email protected] /]# cd /app[[email protected] app]# wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.54-linux2.6-x86_64.tar.gz二.解压mysql-5.5.54-linux2.6-x86_64.ta

linux centos7 安装mysql-5.7.17教程(图解)

1系统约定安装文件下载目录:/data/softwareMysql目录安装位置:/usr/local/mysql数据库保存位置:/data/mysql日志保存位置:/data/log/mysql 2下载mysql在官网:http://dev.mysql.com/downloads/mysql/ 中,选择以下版本的mysql下载: 执行如下命名:#mkdir /data/software#cd /data/software --下载安装包 --建议:在windows上使用迅雷下载,速度很快(我的是

centos7安装 MySQL5.7.19

环境:虚拟机+centos7 1.下载二进制包,下面mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz链接是官网 cd /usr/local/src wget  https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz 2.解压,改名 [[email protected] src]# tar zxvf mysql-5.7.19-linux-gl

linux centos7安装 mysql-5.7.11

1.下载和解压mysql数据库 wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-linux-glibc2.5-x86_64.tar.gzs tar -xvf mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz -C /usr/local/mysql-5.7.11 2.建立软链接 ln -s mysql-5.7.11 mysql 3.创建mysql用户和修改软件的权限 useradd -r

Linux Centos7 安装Mysql5.7

1.查看系统自带的mysql rpm -qa | grep mysql 2.如果有版本安装 将其卸载 rpm -e --nodeps 自带的mysql版本 3.下载mysql官方的Yum Repository wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm 安装MySQ

Linux CentOS7安装Mysql5.7

一.下载mysql mkdir /home/install #创建install目录 在/home/install目录下下载mysql5.7 wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz 下载完成 二.解压到 /usr/local/msyql 解压 tar -zxvf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz 移动到

CentOS6.9 下编译安装MySQL5.7.19

官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 1.下载mysql并解压 [[email protected] ~]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz [[email protected] ~]# tar xf mysql-5.7.19.ta

Linux上安装MySQL5.6

OS & MySQL的版本和配置: MySQL Version: 5.6.19 Linux Version: Linux boston.oracle.com 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux 一,下载MySQL安装软件,请到www.oracle.com   去找DATABASE DOWNLOAD,下载MySQL需要注册一个账号.我下载的版本如下: 下载后解压就是以下的8个文件 :

centos6.5 rpm安装mysql5.6.19

1,检查MySQL及相关RPM包,是否安装,如果有安装,则移除. rpm -qa | grep -i mysql yum -y remove mysql-libs* 2,根据系统下载RPM包,我下载的MySQL-5.6.19-1.el6.i686.rpm-bundle.tar 解压压缩包,依次安装: rpm -ivh MySQL-server-5.6.19-1.el6.i686.rpm rpm -ivh MySQL-devel-5.6.19-1.el6.i686.rpm rpm -ivh MyS