Home > Database > Mysql Tutorial > centos 7安装mysql5.5的方法_MySQL

centos 7安装mysql5.5的方法_MySQL

WBOY
Release: 2016-05-30 17:10:20
Original
1059 people have browsed it

首先centos7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤。

#列出所有被安装的rpm package
rpm -qa | grep mariadb

#卸载
rpm -e mariadb-libs-5.5.37-1.el7_0.x86_64
错误:依赖检测失败:
libmysqlclient.so.18()(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要
libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要

#强制卸载,因为没有--nodeps
rpm -e --nodeps mariadb-libs-5.5.37-1.el7_0.x86_64

#安装mysql依赖
yum install vim libaio net-tools

#安装mysql5.5.39的rpm包
rpm -ivh /home/liwei/MySQL-server-5.5.39-2.el6.x86_64.rpm

rpm -ivh /home/liwei/MySQL-client-5.5.39-2.el6.x86_64.rpm

#拷贝配置文件
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf,改名为my.cnf作为mysql配置文件。

#修改响应的配置文件
vim /etc/my.cnf

#把mysql的data拷贝到制定的目录
mv /var/lib/mysql /home/mysql/data/

还要注意目录的属主和权限。

MYSQL启动后报:ERROR! The server quit without updating PID file错误的问题解决
MYSQL日志:Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)


1、权限不够:chown -R mysql:mysql /home/mysql/data” “chmod -R 755 /home/mysql/data
2、centos7的selinux问题:打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器。

下面看下其他网友的补充:

1、centos下yum暂时没有mysql-server直接安装包;
MariaDB是MySQL社区开发的分支,也是一个增强型的替代品;

2、安装MariaDB
yum -y install mariadb-server mariadb mariadb-devel
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
firewall-cmd --permanent --add-service mysql
systemctl restart firewalld.service
iptables -L -n|grep 3306

3、登录数据库查看下是否有变好
msyql -uroot -p
show databases;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template