CentOS:MariaDB安装
CentOS6
MariaDB官方提供了不同Linux发行版的repository,提供了安装源配置工具。下面是CentOS6 x64,安装10.0
# MariaDB 10.0 CentOS repository list - created 2015-08-28 01:32 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
安装
yum install MariaDB-server MariaDB-client
安装完后修改默认端口
cd /etc/my.cnf.d
vim server.conf
[mysqld]
port=3307
修改root用户密码
mysqladmin -uroot -p password
创建一个数据库
create database js_huanan_db default charset utf8 collate utf8_general_ci;
use js_huanan_db;
create user js identified by '123456';
grant all on js_huanan_db.* to 'js'@'%';
flush privileges;
注意js@localhost 和js@%密码竟然不一样!蛋疼
CentOS7
RH7默认的mysql已经变成mariadb。
yum install mariadb-server mariadb
systemctl start mariadb
systemctl enable mariadb
#协助执行mysql配置。默认密码为空
mysql_secure_installation