mysql 指定版本安装

CentOS Mysql 指定版本安装

1.检查mysql rpm相关的包是否安装(很重要!!!)

rpm -qa | grep -i mysql

mysql-libs-5.1.61-4.el6.x86_64 如果存在则删除

yum -y remove mysql-libs 删除依赖包。

2.下载制定版本rpm包 http://downloads.mysql.com/archives/community/

选择Linux 通用版本

Client Utilities 和 MySQL Server 还有mysql-devel 三个都需要下载安装

使用 wget 复制的下载连接下载mysql-server、mysql-client和mysql-devel

3.下载完成后,安装rpm包

Rpm -ivh MySQL-server-5.6.10-1.linux_glibc2.5.x86_64.rpm

错误信息

原因缺少libaio库

解决方法

wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm

rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm 安装

原因:缺少依赖包perl

解决方法:yum -install -y perl

安装mysql-client

wget http://downloads.mysql.com/archives/get/file/MySQL-client-5.6.10-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-client-5.6.10-1.linux_glibc2.5.x86_64.rpm

安装mysql-devel

wget http://downloads.mysql.com/archives/get/file/MySQL-devel-5.6.10-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-devel-5.6.10-1.linux_glibc2.5.x86_64.rpm

4.安装成功后修改配置文件

vi /etc/my.cnf

[mysqld]

# Options for mysqld process:

#skip-grant-tables

character_set_server=utf8

lower_case_table_names=1

max_connections=1000

datadir=/var/lib/mysql

清空之后把上面的复制进去保存退出

5.开启mysql服务

Service mysql start

6.修改mysql密码

service mysql stop

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

mysql -u root

use mysql

UPDATE user SET password=password("server") WHERE user='root';

修改后的密码为server

原文地址:https://www.cnblogs.com/uyahs/p/7670392.html