阿里云ECS服务器CentOS7上安装MySql服务

  • 时间:
  • 浏览:1

[root@localhost ~]# yum -y update

[root@localhost ~]# yum -y remove mysql-community-libs-5.7.20-1.el7.x86_64

mysql>show databases;

  grub2.x86_64 1:2.02-0.64.el7.centos   grub2-tools.x86_64 1:2.02-0.64.el7.centos

要我我显示以下内容说明要我我更新完成

-bash: gerp: command not found

[root@localhost ~]# systemctl enable mysqld.service

# 查看当前的启动的 MySQL 版本

[root@localhost ~]# yum list installed | grep mysql

# 退出登录数据库

[root@localhost ~]# yum install mysql-community-server 

[root@localhost ~]# rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

[root@localhost ~]# rpm -qa | grep mysql

# 查看MySQL服务情况表

[root@localhost ~]# rpm -e mysql-community-libs-5.7.20-1.el7.x86_64 --nodeps

----------------------------------------------

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'a123456!' WITH GRANT OPTION;

[root@localhost ~]# systemctl stop mysqld

# 查看MySql相关文件

要我 功能:

mysqld.service                                enabled

[root@localhost ~]# systemctl list-unit-files | grep mysqld

11.修改当前用户密码

[root@localhost ~]# systemctl status mysqld

阿里云ECS服务器CentOS7上安装MySql服务

[root@localhost ~]# yum repolist all | grep mysql

[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log

mysql>exit;

3.首先检查否有要我我安装,要我我要我我安装先删除随后版本,以免安装不成功

# 查看所有数据库

[root@localhost ~]# find / -name mysql

[root@localhost ~]# systemctl start mysqld.service

[root@localhost ~]# php -v

# 关闭MySQL服务

mysql>flush privileges;

[root@localhost ~]# systemctl start mysqld

mysql>SET PASSWORD = PASSWORD('Abc123!_');

使用root登录

[root@localhost ~]# mysql

# 测试MySQL否有安装成功

[root@localhost ~]# whereis mysql

# 查看MySQL安装目录

Complete!

[root@localhost ~]# service mysqld restart

[root@localhost ~]# yum remove -y mysql mysql mysql-server mysql-libs compat-mysql51

# 检查要我我显示Apache相关安装包

[root@localhost ~]# yum install mysql-community-server

# 通过Yum来安装MySQL,会自动处理MySQL与要我 组件的依赖关系

10.登陆MySql,输入用户名和密码

[root@localhost ~]# yum install -y mysql-server

mysql>SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

要我我显示以下内容说明安装成功

13.命令立即执行生效

要我我显示以下内容说明越来越安装服务

6.设置开机启动Mysql

# 删除MySql

9.查看MySql默认密码

4.下载MySql安装包

# 查看所有数据库用户

---------------------------------------------------------------------

[root@localhost ~]# mysql -uroot -p

[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log

5.安装MySql

[root@localhost ~]# rpm -qa | gerp mysql

7.检查否有要我我安装了开机自动启动

Complete!

# 查看MySql默认密码

# 重启MySql服务

[root@localhost ~]# reboot

12.开启远程登录,授权root远程登录

[root@localhost ~]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

2.重启服务器

8.设置开启服务

# 启动MySQL服务

1.确保服务器系统发生最新情况表

# 查看MySql版本

Replaced:

要我我显示以下内容说明要我我完成自动启动安装

[root@localhost ~]# yum repolist enabled | grep mysql