首页 > 系统相关 >Ubuntu 22.04 安装MariaDB 提供本地服务

Ubuntu 22.04 安装MariaDB 提供本地服务

时间:2024-06-21 09:21:07浏览次数:14  
标签:... MariaDB Success mysql 22.04 Ubuntu password root

  1. 打开终端。

  2. 更新包列表:

    sudo apt update

  3. 安装MariaDB服务器:

    sudo apt install mariadb-server
  4. 安装完成后,运行安全安装脚本来设置密码和调整安全选项:

    sudo mysql_secure_installation
    root@seafile-server:/opt# 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
    haven't set the root password yet, you should just press enter here.
    
    Enter current password for root (enter for none):
    OK, successfully used password, moving on...
    
    Setting the root password or using the unix_socket ensures that nobody
    can log into the MariaDB root user without the proper authorisation.
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Switch to unix_socket authentication [Y/n] n
     ... skipping.
    
    You already have your root account protected, so you can safely answer 'n'.
    
    Change the root password? [Y/n] Y
    New password:
    Re-enter new password:
    Password updated successfully!
    Reloading privilege tables..
     ... Success!
    
    
    By default, a MariaDB installation has an anonymous user, allowing anyone
    to log into MariaDB without having to have a user account created for
    them.  This is intended only for testing, and to make the installation
    go a bit smoother.  You should remove them before moving into a
    production environment.
    
    Remove anonymous users? [Y/n] Y
     ... Success!
    
    Normally, root should only be allowed to connect from 'localhost'.  This
    ensures that someone cannot guess at the root password from the network.
    
    Disallow root login remotely? [Y/n] Y
     ... Success!
    
    By default, MariaDB comes with a database named 'test' that anyone can
    access.  This is also intended only for testing, and should be removed
    before moving into a production environment.
    
    Remove test database and access to it? [Y/n] Y
     - Dropping test database...
     ... Success!
     - Removing privileges on test database...
     ... Success!
    
    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.
    
    Reload privilege tables now? [Y/n] Y
     ... Success!
    
    Cleaning up...
    
    All done!  If you've completed all of the above steps, your MariaDB
    installation should now be secure.
    
    Thanks for using MariaDB!
    root@seafile-server:/opt# systemctl
  5. 启动MariaDB服务:

    sudo systemctl start mysql
  6. 设置MariaDB服务开机自启:

    sudo systemctl enable mysql
  7. 登录到MariaDB以确保一切正常:

    mysql -u root -p

    输入你在安全安装期间设置的密码

标签:...,MariaDB,Success,mysql,22.04,Ubuntu,password,root
From: https://www.cnblogs.com/Magiclala/p/18259905

相关文章

  • ubuntu下使用spdk-rs
    尝试编译安装nixpkgssh<(curl-Lhttps://nixos.org/nix/install)--daemon为nixpkgs换源nix-channel--addhttps://mirrors.ustc.edu.cn/nix-channels/nixpkgs-unstablenixpkgsnix-channel--update对于单独安装的Nix,需要修改或添加相应的配置(~/.config/nix/nix.conf......
  • Android AOSP Ubuntu 开发环境配置
    在下载和构建Android源代码的 main 分支之前,请确保您的硬件满足必要的要求,并已正确安装所需的软件。您还应熟悉以下术语:GitGit是一个免费的开源分布式版本控制系统。Android使用Git执行本地操作,例如建立分支、提交、对比差异、修改。如需Git学习帮助,请参阅 Git文......
  • Linux学习笔记(一)(以Ubuntu为例)
    Linux操作命令的笔记(一)(Ubuntu)其实Linux不同发行版的基础命令区别不大。Linux命令基础格式命令通用格式:command[-options][parameter][]表示可选的意思command:命令本身-options:[可选,非必填]命令的一些选项,可以通过选项控制命令的行为细节parameter:[可选,非必填]命令......
  • 【问题】Ubuntu下使用ftp命令下载文件
    Ubuntu下使用ftp命令下载文件具体的方法示例如下:$ ftp192.168.180.3Connectedto192.168.180.3.Name(192.168.180.3:test):此处输入用户名 Password:此处输入对应的密码/*查看当前路径*/ftp> pwd257"/"iscurrentdirectory. ftp>cdtest250CWDcommands......
  • VirtualBox Ubuntu 22.04 Server联网、与主机互联
    使用VirtualBox7.0安装了两个Ubuntu22.04Server虚拟机,想要实现:主机与虚拟机互联虚拟机之间互联,且互联的IP应为静态虚拟机可以联网解决方法每个虚拟机配置两个虚拟网卡:一个为桥接网络模式,用于联网以及与主机互联一个为仅主机模式,用于配置静态IP并实现虚拟机之间互联......
  • 【Ubuntu开发入门之“悟空派wukongpi/香橙派orangepi H3 linux开发②u-boot移植“】
    Ubuntu开发入门之"orangepiH3linux开发@u-boot移植"问题描述解决方法获取u-boot源码编译配置u-boot制作并烧录TF卡结束语郑重声明:本人原创博文,都是实战,均经过实际项目验证出货的转载请标明出处:攻城狮2015Platform:AllwinnerH3OS:Linuxubunt......
  • docker(ubuntu18.04) + 宿主机(ubuntu20.04) + ROS + 乐视三合一体感摄像头LeTMC-520
    参考链接:https://blog.csdn.net/weixin_45225720/article/details/1144642441.准备docker环境dockerpullhyeonjaegil/vins-monodockerrun-it--privileged--networkhost--gpusall\-v/tmp/.X11-unix:/tmp/.X11-unix\-eDISPLAY-eNVIDIA_VISIBLE_DEVIC......
  • MobaXterm的安装与使用(连接Ubuntu)
    1.简介MobaXterm是一款Windows平台下的终端软件,集成了很多功能,如SSH、telnet、RDP、VNC、FTP、SFTP、X11、以及Unix命令行环境等。它可以方便地管理远程服务器,并提供了图形化的文件传输和编辑功能。MobaXterm的主要特点包括:全面的网络工具:包括SSH、telnet、RDP、VN......
  • 解决Ubuntu 下 idea Dock 图标显示错乱
    问题表现通过官网下载的ideaubuntu安装包安装之后,默认是需要通过sh脚本运行的,我们可以通过在/usr/share/applications创建一个.desktop的文件,来生成一个可以被ubuntu识别的应用。在我的Ubuntu下,idea的配置如下:[DesktopEntry]Name=IntelliJIDEAComment=IntelliJ......
  • Ubuntu-24-04-LTS-稳定正式版安装
    一、介绍说明Ubuntu24.04LTS已正式发布,代号“NobleNumbat”。Canonical首席执行官MarkShuttleworth称Ubuntu24.04LTS会提供至少12年的支持,并在性能工程和机密计算方面提升明显,还集成了通过TCK认证的LTS版本Java、.NET和最新的Rust工具链。主要亮点如下:......