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

  • 时间:
  • 浏览:0
  • 来源:大发5分快3APP下载_大发5分快3APP官方

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

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

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

7.检查与否因为安装了开机自动启动

# 查看所有数据库

13.命令立即执行生效

[root@localhost ~]# systemctl start mysqld

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

# 查看MySql版本

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

[root@localhost ~]# systemctl status mysqld

mysql>show databases;

6.设置开机启动Mysql

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

2.重启服务器

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

9.查看MySql默认密码

Complete!

因为显示以下内容说明安装成功

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

[root@localhost ~]# whereis mysql

-bash: gerp: command not found

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

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

# 退出登录数据库

Complete!

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

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

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

mysql>flush privileges;

因为显示以下内容说明因为完成自动启动安装

# 启动MySQL服务

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

或多或少功能:

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

使用root登录

5.安装MySql

# 查看MySql默认密码

[root@localhost ~]# php -v

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

3.首先检查与否因为安装,因为因为安装先删除后来版本,以免安装不成功

# 检查而且 显示Apache相关安装包

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

# 测试MySQL与否安装成功

Replaced:

[root@localhost ~]# service mysqld restart

因为显示以下内容说明因为更新完成

[root@localhost ~]# reboot

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

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

1.确保服务器系统趋于稳定最新情况

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

mysql>exit;

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

# 查看MySQL安装目录

# 通过Yum来安装MySQL,会自动处里MySQL与或多或少组件的依赖关系

因为显示以下内容说明没法 安装服务

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

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

[root@localhost ~]# systemctl stop mysqld

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

8.设置开启服务

# 关闭MySQL服务

# 查看MySql相关文件

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

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

[root@localhost ~]# mysql

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

# 删除MySql

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

mysqld.service                                enabled

# 查看MySQL服务情况

[root@localhost ~]# yum -y update

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

11.修改当前用户密码

# 查看所有数据库用户

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

4.下载MySql安装包

# 重启MySql服务