1. 安装mariadb
// 安装命令
yum -y install mariadb mariadb-server
// 启动
systemctl start mariadb
// 开机启动
systemctl enbale mariadb
2. 配置
// 执行配置命令
mysql_secure_installation
Enter current password for root (enter for none):<–初次运行直接回车
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
//测试登陆
mysql -uroot -p123456
3. 配置远程登陆
// 登陆
mysql -uroot -p123456
//授权; %:表示从任何主机连接到mysql服务器
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; // %:表示从任何主机连接到mysql服务器
//刷新授权
FLUSH PRIVILEGES;
4. 设置大小写不敏感
- 修改/etc/my.cnf, 去除"!includedir /etc/my.cnf.d"前!
- 修改/etc/my.cnf.d, 在[mysqlld]下加入 lower_case_table_names=1 , 默认等于0,为大小写敏感