标签:开机启动 tar art nat har repos character disk 数据
本文意在指导使用YUM来安装最新版mariadb新建repo文件
touch /etc/yum.repos.d/MariaDB.repo
官方源
[mariadb]
name = MariaDB-10.3.9
baseurl=http://yum.mariadb.org/10.3.9/centos7-amd64
# alternative: baseurl=http://archive.mariadb.org/mariadb-10.3.9/yum/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
中科大源
[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
导入GPG
rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
安装Mariadb数据库
[root@YunDisk Exdisk]# yum install mariadb mariadb-server
设置MariaDB
[root@YunDisk Exdisk]# systemctl start mariadb
[root@YunDisk Exdisk]# systemctl stop mariadb
[root@YunDisk Exdisk]# systemctl enable mariadb
[root@YunDisk Exdisk]# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
修改数据库为UTF8(支持中文)
[root@YunDisk Exdisk]# vim /etc/my.cnf
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
再次启动MariaDB
[root@YunDisk Exdisk]# systemctl start mariadb
设置密码
[root@YunDisk Seafile]# mysql -uroot -p
MariaDB [(none)]> use mysql;
MariaDB [mysql]> update user set password=PASSWORD(‘123456‘) where user="root";
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> quit
标签:开机启动 tar art nat har repos character disk 数据
原文地址:https://blog.51cto.com/14694691/2499162