数据库技术LNMP搭建

mysql / mariadb / Percona 数据库安装方

2019-03-16  本文已影响5人  一生悬命Cat

1.mysql / mariadb 安装方法

1.先切换成阿里源

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2.清空yum 缓存

yum clean all

3.执行

yum  makecache

4.安装mysql

yum install wget
yum install mysql
yum install mysql-devel

5.安装mysql-server / mariadb

安装mysql-community-server
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

安装mariadb
yum install mariadb-server mariadb 

6.登录后重设密码,获取远程连接权限

 mysql -u root 
grant all privileges  on *.* to root@'%' identified by "password";

7.配置mysql / mariadb

vi /etc/my.cnf
[mysql]
default-character-set =utf8

2. Percona安装方法

安装percona
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpmyum  
install  Percona-Server-server-57

需要配置PXC时
[mysqld]
character_set_server = utf8
bind-address = 0.0.0.0
#跳过DNS解析skip-name-resolve


3.开启防火墙3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanentfirewall-cmd --reload
上一篇下一篇

猜你喜欢

热点阅读