当前位置:   article > 正文

Deep Linux 安装Mariadb数据库_note: running all parts of this script is recommen

note: running all parts of this script is recommended for all mariadb server

DeepLinux下安装MariaDB

1、通过DeepLinux的应用商店安装“新立得软件包管理器”,运行“新立得软件包管理器”,搜索“MariaDB”选择MariaDB-server,进行安装。也可以bash下通过 sudo apt install mariadb-server 安装。

2、改密码

 sudo systemctl start mariadb(或mysql)启动服务

(base) xyswxxzx@xyswxxzx-PC:~$ sudo mysqladmin -uroot -p password
Enter password: 
这里输入你设定的密码。

3、还有一个方法mysql_secure_installation这个命令:

(base) xyswxxzx@xyswxxzx-PC:~$ mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
这里输入当前密码,然后 再输入新密码。

4、忘记Root密码后修改的方法 

先要停止服务 sudo systemctl stop mariadb(mysql)

然后

(base) xyswxxzx@xyswxxzx-PC:~$sudo  mysqld_safe --skip-grant-tables

(base) xyswxxzx@xyswxxzx-PC:~$sudo mysql -u root   就可以不用密码直接登录。

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/786720
推荐阅读
相关标签
  

闽ICP备14008679号