文章大纲
1. Linux 默认源
2. 安装mysql
3. 常用命令
4. 常见错误处理
1. Linux 默认源
新版本的Linux 系统默认集成的是MariaDB,所以默认的Yum Repository 没有MySql Repository 。因此Linux中安装MySql需要先安装MySql的 Repository.
安装步骤:
下载yum Repository :
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
(这是是最新的版本,如果需要下载别的版本到MySql的yum repository 官网下载:http://dev.mysql.com/downloads/repo/yum/)
2. YUM安装MySql
安装 Repository:
yum install mysql57-community-release-el7-7.noarch.rpm
查询yum mysql 源:
yum list|grep mysql
可以看到如下的源
mysql-community-client.x86_64 5.7.11-1.el7 @mysql57-community
mysql-community-common.x86_64 5.7.11-1.el7 @mysql57-community
mysql-community-libs.x86_64 5.7.11-1.el7 @mysql57-community
mysql-community-libs-compat.x86_64 5.7.11-1.el7 @mysql57-community
mysql-community-server.x86_64 5.7.11-1.el7 @mysql57-community
mysql57-community-release.noarch el7-7 installed
安装Mysql:
yum install mysql
3. 常见命令
CentOS7 以后操作命令改成:systemctl
启动:
systemctl start mysqld
停止
systemctl stop mysqld
重启
systemctl restart mysqld
4.常见错误
暂无