yum安装mysql依赖包_yum安装MySQL5.7

yum安装MySQL5.7

有的时候,开发测试环境没有高性能的要求。因此,配置MySQL版本的时候。简单配置,也需即可达到目的。

1.卸载MySQL(原有的)

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

mysql-libs-5.1.73-7.el6.x86_64

[root@localhost ~]# rpm -e mysql-libs

error: Failed dependencies:

libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64

libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64

mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64

[root@localhost ~]# rpm -e --nodeps mysql-libs

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

2.MySQL5.7的基础包

[root@youxi2 ~]# yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio libaio-devel net-tools  //安装依赖包

[root@localhost opt]# yum -y install numactl

3.下载&安装MySQL5.7 for CentOS 6

[root@localhost ~]# cat /etc/issue

CentOS release 6.8 (Final)

Kernel \r on an \m

开始安装MySQL5.7

[root@localhost opt]# rpm -ivh mysql-community-common-5.7.30-1.el6.x86_64.rpm

[root@localhost opt]# rpm -ivh mysql-community-libs-5.7.30-1.el6.x86_64.rpm

[root@localhost opt]# rpm -ivh mysql-community-client-5.7.30-1.el6.x86_64.rpm

[root@localhost opt]# rpm -ivh mysql-community-server-5.7.30-1.el6.x86_64.rpm

[root@localhost opt]# rpm -ivh mysql-community-devel-5.7.30-1.el6.x86_64.rpm

4.创建MySQL数据库的数据目录

mkdir -p /opt/mysql/data

chown -R mysql:mysql /opt/mysql/data/

修改配置文件

[root@localhost lib]# cat /etc/my.cnf

###修改数据目录位置

datadir=/opt/mysql/data

5.初始化MySQL数据库

[root@localhost lib]# service mysqld start

初始化 MySQL 数据库: [确定]

正在启动 mysqld: [确定]

[root@localhost lib]# service mysqld status

mysqld (pid 20017) 正在运行...

6.使用临时生成的MySQL密码登录

[root@localhost lib]# mysql -uroot -p'f36LZ>f)Wkgb'

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.7.30

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

7.修改MySQL的密码策略

mysql> set password for root@localhost=password('Mysqlxxxxxxx');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值