Kali系统安装MariaDB教程

第一步:代码:apt install mariadb-client -y

第二部:代码:apt install mariadb-server -y 

第三步:设置开机启动服务:systemctl enable mysql

                停止mysql服务 : systemctl disable mysql 

                然后启动mysql : systemctl start mysql

 第四步:sudo mysql_secure_installation 配置数据库的密码

        

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none)
# ,输入系统的密码,按回车健

后面全部选择Y,

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password: 
#这里是创建数据库 root 登录密码
Re-enter new password: 
#这里是再次输入 root 登录密码

后面也全部是Y

第五步:mysql -u root -p 输入密码

Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 67
Server version: 10.5.12-MariaDB-1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

 后面就开始创建用户。

第六步、 创建用户:CREATE USER '用户名'@'%' IDENTIFIED BY '密码';

        返回:Query OK, 0 rows affected (0.008 sec) 表示成功
 

第七步、 授权用户远程登录:grant all privileges on *.* to '用户'@'%' with grant option;

        返回:Query OK, 0 rows affected (0.008 sec) 表示成功

第八步、刷新: flush privileges; 

         返回:Query OK, 0 rows affected (0.008 sec) 表示成功

第九步、修改一个配置文件 : vim /etc/mysql/mariadb.conf.d/50-server.cnf

        注释掉:bind-address = 127.0.0.1

 最后重启 mariadb 服务: systemctl restart mysql 完

  • 6
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cyz141001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值