Centos7上卸载Mariadb数据库
查询所安装的MariaDB组件:
[root@localhost logs]# rpm -qa | grep Maria*
MariaDB-server-5.5.49-1.el7.centos.x86_64
MariaDB-common-5.5.49-1.el7.centos.x86_64
MariaDB-client-5.5.49-1.el7.centos.x86_64
卸载数据库:
[root@localhost logs]# yum -y remove Mari*
删除数据库文件:
[root@localhost logs]# rm -rf /var/lib/MySQL/*
安装
yum -y install mariadb mariadb-server
启动
systemctl start mariadb
系统开启自启动
systemctl enable mariadb
接下来进行MariaDB的相关简单配置
mysql_secure_installation
修改字符集
vim /etc/my.conf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server=utf8
collation-server=utf8_bin
添加用户和远程授权
mysql> grant all privileges on *.* to root@'%'identified by 'password';