广告
返回顶部
首页 > 资讯 > 精选 >Ubuntu中怎么安装MariaDB
  • 784
分享到

Ubuntu中怎么安装MariaDB

2023-06-05 11:06:34 784人浏览 八月长安
摘要

ubuntu中怎么安装MariaDB,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。安装MariaDBwuxiangping@linuxcool:~$ 

ubuntu中怎么安装MariaDB,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

安装MariaDB

wuxiangping@linuxcool:~$ sudo apt updatewuxiangping@linuxcool:~$ sudo apt install mariadb-server

安装完成后,MariaDB服务将自动启动。

验证数据库服务器运行状态

wuxiangping@linuxcool:~$ sudo systemctl status mariadb.service

Ubuntu中怎么安装MariaDB

查看数据库版本号

wuxiangping@linuxcool:~$ mysql --versionMysql  Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Ubuntu中怎么安装MariaDB

MariaDB安全配置,初始化数据

MariaDB服务器软件包自带一个名为mysql_secure_installation的脚本,可以轻松提高数据库服务器的安全性。

wuxiangping@linuxcool:~$ sudo mysql_secure_installationNOTE: 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 currentpassWord for the root user.  If you've just installed MariaDB, andyou 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):     直接回车OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.You already have a root password set, so you can safely answer 'n'.Change the root password? [Y/n] y    设置root用户密码New password: Re-enter new password: Password updated successfully!Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem.  This is intended only for testing, and to make the installationGo a bit smoother.  You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] y    删除匿名用户 ... Success!NORMally, root should only be allowed to connect from 'localhost'.  Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] y  禁止root原创连接 ... Success!By default, MariaDB comes with a database named 'test' that anyone canaccess.  This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] y   删除默认的test数据库名 - Dropping test database... ... Success! - Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill 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 MariaDBinstallation should now be secure.Thanks for using MariaDB!

Ubuntu中怎么安装MariaDB

本地root用户登录

shell与MariaDB交互操作,运行时会提示输入系统用户名的密码

wuxiangping@linuxcool:~$ sudo mysql[sudo] wuxiangping 的密码: Welcome to the MariaDB monitor.  Commands end with ; or \g.Your MariaDB connection id is 49Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04Copyright (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)]>

授权MariaDB指定主机远程访问

默认监听端口是127.0.0.1,需要修改为主机IP

wuxiangping@linuxcool:~$ sudo vim /etc/mysql/mariadb.conf.d/50-server.cnfbind-address=127.0.0.1修改为bind-address=192.168.3.22

Ubuntu中怎么安装MariaDB

MariaDB [(none)]> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.3.8' IDENTIFIED BY 'password' WITH GRANT OPTION;Query OK, 0 rows affected (0.00 sec)MariaDB [mysql]> flush privileges;Query OK, 0 rows affected (0.00 sec)MariaDB [mysql]> select host, user from user;   #查看MySQL数据库user表

Ubuntu中怎么安装MariaDB

重启mariadb服务

wuxiangping@linuxcool:~$ sudo systemctl restart mariadb.service

远程主机连接测试

Ubuntu中怎么安装MariaDB

Ubuntu中怎么安装MariaDB

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注编程网精选频道,感谢您对编程网的支持。

--结束END--

本文标题: Ubuntu中怎么安装MariaDB

本文链接: https://www.lsjlt.com/news/242798.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Ubuntu中怎么安装MariaDB
    Ubuntu中怎么安装MariaDB,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。安装MariaDBwuxiangping@linuxcool:~$ ...
    99+
    2023-06-05
  • Ubuntu下怎么安装配置MariaDB
    本篇内容主要讲解“Ubuntu下怎么安装配置MariaDB”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Ubuntu下怎么安装配置MariaDB”吧!MariaDB数据库管理系统是 MySQL ...
    99+
    2023-06-28
  • 怎么在Debian和Ubuntu上安装MariaDB 10
    小编给大家分享一下怎么在Debian和Ubuntu上安装MariaDB 10,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!MariaDB 是深受欢迎的数据库管理服...
    99+
    2023-06-16
  • Ubuntu上如何安装MariaDB
    今天小编给大家分享一下Ubuntu上如何安装MariaDB的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。一、前提条件你需要拥...
    99+
    2023-07-04
  • DeepinV20中怎么安装Mariadb
    本篇文章为大家展示了DeepinV20中怎么安装Mariadb,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。安装Mariadb首先可以查看系统是否已经安装MariaDB或MySQL数据库MariaD...
    99+
    2023-06-20
  • MariaDB怎么安装与配置
    本篇内容介绍了“MariaDB怎么安装与配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!MariaDB的安装与配置MariaDB是MySQ...
    99+
    2023-07-02
  • Ubuntu中怎么安装FFmpeg
    这篇文章主要介绍Ubuntu中怎么安装FFmpeg,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!在安装ffmpeg之前,首先要安装yasm这么个家伙。1.安装yasm我用的yasm是yasm-1.2.0.tar.gz...
    99+
    2023-06-13
  • Ubuntu中怎么安装moodle
    这篇文章主要介绍“Ubuntu中怎么安装moodle”,在日常操作中,相信很多人在Ubuntu中怎么安装moodle问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ubuntu中怎么安装moodle”的疑惑有所...
    99+
    2023-06-27
  • ubuntu中怎么安装php5.6
    这篇文章主要讲解了“ubuntu中怎么安装php5.6”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“ubuntu中怎么安装php5.6”吧!1.打开终端命令行模式。2.首先输入命令安装依赖包...
    99+
    2023-07-04
  • ubuntu中怎么安装oracle
    本篇文章为大家展示了ubuntu中怎么安装oracle,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。 具体步骤如下:(1)安装系统,安装系统起用户名的时候...
    99+
    2022-10-18
  • Ubuntu中怎么安装pip
    今天就跟大家聊聊有关Ubuntu中怎么安装pip,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。pip 是一个命令行工具,允许你安装 Python 编写的软件包。 学习如何在 Ubun...
    99+
    2023-06-16
  • ubuntu中怎么安装iperf
    这篇“ubuntu中怎么安装iperf”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“ubuntu中怎么安装iperf”文章吧...
    99+
    2023-07-04
  • Ubuntu中怎么安装Erlang
    本篇内容主要讲解“Ubuntu中怎么安装Erlang”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Ubuntu中怎么安装Erlang”吧!Erlang是一个结构化,动态类型编程语言,内建并行计算...
    99+
    2023-06-27
  • Ubuntu中怎么安装Anaconda
    本篇内容介绍了“Ubuntu中怎么安装Anaconda”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!anaconda 是一个python的发...
    99+
    2023-06-27
  • ubuntu中怎么安装Kdevelop
    ubuntu中怎么安装Kdevelop,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。一、ubuntu下安装Kdevelop有两种方式进行安装:使用终端:使用apt-get可...
    99+
    2023-06-17
  • Ubuntu中怎么安装WebStorm
    这篇文章主要介绍“Ubuntu中怎么安装WebStorm”,在日常操作中,相信很多人在Ubuntu中怎么安装WebStorm问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ubuntu中怎么安装WebStorm...
    99+
    2023-06-27
  • Ubuntu中怎么安装Scala
    这篇文章主要讲解了“Ubuntu中怎么安装Scala”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Ubuntu中怎么安装Scala”吧!Scala是一种类似Java的纯面向对象的函数式编程语...
    99+
    2023-06-27
  • Ubuntu中怎么安装rawtherapee
    这篇文章主要介绍了Ubuntu中怎么安装rawtherapee的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Ubuntu中怎么安装rawtherapee文章都会有所收获,下面我们一起来看看吧。rawtherap...
    99+
    2023-06-27
  • Ubuntu中怎么安装Discourse
    本篇内容主要讲解“Ubuntu中怎么安装Discourse”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Ubuntu中怎么安装Discourse”吧!Discourse 是 Stack Over...
    99+
    2023-06-27
  • Ubuntu中怎么安装Discord
    这篇文章主要介绍“Ubuntu中怎么安装Discord”,在日常操作中,相信很多人在Ubuntu中怎么安装Discord问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ubuntu中怎么安装Discord”的疑...
    99+
    2023-06-28
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作