创建一个 MariaDB 数据库,名为 Contacts,并符合以下条件:  数据库只能被 localhost 访问  除了 root 用户,此数据库只能被用户 Raikon 查询,此用户密码为 atenorth  root 用户的密码为 atenorth,同时不允许空密码登陆
1)安装、配置
[[email protected] ~]# yum -y install mariadb-server mariadb
[[email protected] ~]# vim /etc/my.cnf
[mysqld]
skip-networking //添加此行,跳过网络
[[email protected] ~]# systemctl restart mariadb
[[email protected] ~]# systemctl enable mariadb
2)设密码、建库
[[email protected] ~]# mysqladmin -u root -p password 'atenorth' //设置密码
[[email protected] ~]# mysql -u root -p
MariaDB [(none)]> create database Contacts;
MariaDB [(none)]> grant select on Contacts. to [email protected] identified by 'atenorth';
MariaDB [(none)]> delete from mysql.user where Password=''; //删除空密码账号
MariaDB [(none)]> QUIT
12月个人指标
12月个人指标
12月个人指标

转载于:https://blog.51cto.com/13673837/2331276

相关文章:

  • 2021-07-01
  • 2021-10-10
  • 2021-07-07
  • 2021-04-13
  • 2021-05-26
  • 2021-09-16
  • 2021-04-14
猜你喜欢
  • 2022-01-09
  • 2021-05-19
  • 2021-05-09
  • 2021-04-17
  • 2021-07-03
  • 2022-12-23
  • 2021-05-29
相关资源
相似解决方案