ecs CentOS 7 安装 mariadb
检查之前是否已经安装
rpm -qa | grep mariadb
如果已安装,卸载
yum remove mysql mysql-server mysql-libs compat-mysql51
开始安装
yum -y install mariadb-server
修改字符编码
vi /etc/my.cnf
[mysqld]
character-set-server=utf8
启动mariadb
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
mysql -u root -p
select user,host,password from mysql.user;
mariadb配置允许远程访问方式
首先配置允许访问的用户,采用授权的方式给用户权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
flush privileges;