首页 > 代码库 > centos7 Mariadb安装

centos7 Mariadb安装

yum install mariadb-server mariadb -y

修改配置:

[mysqld]

default-storage-engine = innodb

innodb_file_per_table

character-set-server = utf8

collation-server = utf8_general_ci

init-connect = ‘SET NAMES utf8‘

?

systemctl start mariadb

systemctl enable mariadb

创建数据库

CREATE DATABASE IF NOT EXISTS cattle COLLATE = ‘utf8_general_ci‘ CHARACTER SET = ‘utf8‘;

GRANT ALL ON cattle.* TO ‘cattle‘@‘%‘ IDENTIFIED BY ‘cattle‘;

GRANT ALL ON cattle.* TO ‘cattle‘@‘localhost‘ IDENTIFIED BY ‘cattle‘;

?

--db-host IP or hostname of MySQL server

--db-port port of MySQL server (default: 3306)

--db-user username for MySQL login (default: cattle)

--db-pass password for MySQL login (default: cattle)

--db-name MySQL database name to use (default: cattle)

centos7 Mariadb安装