Debian安装mysql

article/2025/9/9 15:57:58

Debian 10系统中默认使用了MariaDB,在APT的软件源中并没有mysql。所以,Debian 10 如果要安装mysql,需要下载安装Mysql APT Repository,更新APT Repository 后再使用 apt-get 安装。

  1. 设置软件源
    点击mysql下载地址,下载Mysql APT Repository(仅限Debian和ubuntu)


    下载Mysql APT Repository(这里使用mysql-apt-config_0.8.19-1_all.deb)后,在命令行执行如下命令
    sudo apt-get install ./mysql-apt-config_0.8.19-1_all.deb
    
    根据提示安装Mysql APT Repository即可。
  2. 安装mysql
    执行命令
    sudo apt-get updateHit:1 https://mirrors.aliyun.com/docker-ce/linux/debian buster InRelease
    Hit:2 http://repo.mysql.com/apt/debian buster InRelease                                                                                                                  
    Hit:3 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease                                                                                       
    Hit:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease                                                                                                      
    Hit:5 https://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease                                                                                                       
    Hit:6 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease                                                                                   
    Hit:7 https://dl.yarnpkg.com/debian stable InRelease                                                                     
    Hit:8 https://deb.nodesource.com/node_13.x buster InRelease
    Get:9 http://repo.mysql.com/apt/debian buster/mysql-8.0 Sources [951 B]
    Get:10 http://repo.mysql.com/apt/debian buster/mysql-8.0 amd64 Packages [6,017 B]
    Fetched 6,968 B in 4s (1,807 B/s)
    Reading package lists... Done
    
    可以看到Mysql APT Repository已经被安装,下面就可以正常使用apt-get安装mysql了。
    apt-get install mysql-server
    

    然后根据提示设置密码,设置密码安全验证方式(推荐强验证方式)。

  3. 处理mysql服务安全问题
    执行如下命令进行安全设置:
    test@test:~$ mysql_secure_installation Securing the MySQL server deployment.#输入在安装mysql时设置的root密码
    Enter password for user root: VALIDATE PASSWORD COMPONENT can be used to test passwords
    and improve security. It checks the strength of password
    and allows the users to set only those passwords which are
    secure enough. Would you like to setup VALIDATE PASSWORD component?Press y|Y for Yes, any other key for No: 
    Using existing password for root.
    #是否重设root密码
    Change the password for root ? ((Press y|Y for Yes, any other key for No) : ... skipping.
    By default, a MySQL installation has an anonymous user,
    allowing anyone to log into MySQL 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.#是否删除用于test的annoymous用户,如果在生产环境下建议删除
    Remove anonymous users? (Press y|Y for Yes, any other key for No) : 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.#是否禁止root远程登录
    Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n... skipping.
    By default, MySQL 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.#是否删除test数据库
    Remove test database and access to it? (Press y|Y for Yes, any other key for No) : n... skipping.
    Reloading the privilege tables will ensure that all changes
    made so far will take effect immediately.#是否让设置立即生效
    Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
    Success.All done!
    

 

数据库



作者:网络小乙
链接:https://www.jianshu.com/p/86df485bd525
来源:简书


http://chatgpt.dhexx.cn/article/bE6D4Lji.shtml

相关文章

linux Deploy 安装debian

一 准备工作 1、一台root的魅蓝note6手机,手机root教程需要自己根据机型搜索 2、去 https://github.com/meefik/linuxdeploy/releases下载linux deploy 3、去https://github.com/meefik/busybox/releases 下载BusyBox (安卓平台虚拟机(chroot运行linux的…

Debian10安装

Debian 10.7(buster) 使用bt文件下载 下载链接:https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/ 这次是在VMware Workstation上安装的,如果是想在实体机上安装的话,需要做个启动盘,就是把ISO文件刻录到USB或DVD上。…

debian安装和基本使用

debian安装和基本使用 由于centos停止更新,改用debian debian下载,官网去下载DVD版本,4g多的体量,包含的软件比较全。 虚拟机安装,如果进入安装界面直接黑屏卡死,要注意是否镜像ISO文件未加挂。手动在虚拟…

Debian10: 系统安装

若非虚拟机安装,需要制作启动U盘,备份好U盘的数据后,使用UltraISO工具或Rufus(http://rufus.ie/)将 debian-10.6.0-amd64-DVD-1.iso文件写入U盘,将此U盘插入服务器,设置服务器从U盘启动即可。 第一步:选择…

安装debian11系统

镜像下载地址:https://gemmei.ftp.acc.umu.se/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso 一、选择图形化安装(这里说一下,这里的图形化安装是安装过程是图形化的,并非是选择系统带图形化界面,…

Debian 系统安装,小白教程

大家好,我是橘子。在工作过程中呢遇到了很多问题,踩了很多坑。网上很多都有教程但总是缺胳膊少腿,说了大概但坑似乎依旧存在。从今天开始,我会将自己碰到的一些坑和如何解决的分享给大家。如果你是个大佬,那我的内容对…

最新发布 Debian 系统的详细安装过程

前言 Debian 究竟是什么?有官方详细介绍说明,在此就不过多介绍说明了,只告知官网,可点击查看官网介绍。 管网连接 :Debian -- About Debian https://www.debian.org/intro/about 平台准备 使用 VMware 平台搭建&…

Debian 11 安装,超详细!

安装装备 华为源中下载镜像 https://repo.huaweicloud.com/debian-cd/11.0.0/amd64/iso-cd/ 3A服务器的虚拟机 开始安装 配置虚拟机 直接回车即可,第一次安装的小伙伴可以选择中文版安装,这样方便易懂, 一路继续,配置网络&a…

如何轻松安装 Debian Linux 系统

安装 Debian 的轻松程度依赖于选择什么镜像。 如果你使用 Debain 官网的默认 ISO 镜像,安装 Debian 就比较费劲。你会卡在这种界面,让你从外部可移动介质上安装网络驱动。 对于新用户来说,从默认的 ISO 中安装 Debian 是有问题的 当然你可以…

IOC 是什么

Ioc—Inversion of Control,即“控制反转”,不是什么技术,而是一种设计思想。在Java开发中,Ioc意味着将你设计好的对象交给容器控制,而不是传统的在你的对象内部直接控制。如何理解好Ioc呢?理解好Ioc的关键…

什么是 IoC 容器?

什么是 IoC 容器? 这个问题我觉得可以拆分为 3 小问: IoC 是什么意思?容器 指什么?IoC 容器是什么? 首先对于 IoC Inversion Of Control 翻译过来即 控制反转。理解 ”控制反转“ ,我觉得首先是要明白&a…

Spring中的IOC是什么意思,为什么要用IOC而不是New来创建实例?

这里是修真院后端小课堂,每篇分享文从 【背景介绍】【知识剖析】【常见问题】【解决方案】【编码实战】【扩展思考】【更多讨论】【参考文献】 八个方面深度解析后端知识/技能,本篇分享的是: 【 Spring中的IOC是什么意思,为什么…

什么是IOC容器

1.IOC不是一种技术,只是一种思想,一个重要的面向对象编程的法则,它能指导我们如何设计出松耦合,更优良的程序。传统应用程序都是由我们在类内部主动创建依赖对象,从而导致类与类之间高耦合,难于测试&#x…

java ioc是什么意思_Java技术面试题解析:举例说明什么是IoC

原标题:Java技术面试题解析:举例说明什么是IoC IoC是什么呢?有些人可能会有疑问? IoC便是Inversion of Control,操控回转。在Java开发中,IoC意味着将你规划好的类交给系统去操控,而不是在你的类…

JAVA的是什么ioc_spring中ioc是什么

IoC——Inversion of Control,控制反转 在Java开发中,IoC意味着将你设计好的类交给系统去控制,而不是在你的类内部控制。IoC是一种让服务消费者不直接依赖于服务提供者的组件设计方式,是一种减少类与类之间依赖的设计原则。 DI——…

java中ioc作用_java中的ioc是什么

java中的ioc是什么 发布时间:2020-06-03 20:01:10 来源:亿速云 阅读:174 作者:Leah java中的ioc是什么相信大部分人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,话不多说,一起往下看吧。 什么是ioc ioc全称是【Inversion of Control】控制反转,按照字面意…

1、重写TextView的onDraw方法

Android重写系统TextView Git源码地址: https://github.com/AndroidAppWidgetDemo/Android_Widget_CustomTextView 一、目的 重写Android系统TextView,是为了解决系统TextView中文换行所带来的参差不齐的锯齿效果。如图1.1为系统TextView的绘制结果&am…

getX()、getRawX()、getTranslationX()、gettranslationX()...

关于屏幕上获取这些位置的情况应该分为两种,一种是在没有点击屏幕时,另外一种是有点击 我们来分别看看这几个X在图形上的直观表示和解释 有点击时的getX() getY() getX()表示触摸点距离view本身左边界的距离getY()表示触摸点距离…

Direct2D函数DWrite

Win8 DirectX 11.1 中 Direct3D 和 Direct2D , DirectWrite 的交互比11方便多了,不用创建什么DX10.1的device,不用搞什么设备同步,直接往同一个DXGI Resource里写就是了。 这大概得益于Win 6.2 底层架构的进一步融合,…

Pthreads on Microsoft Windows

Posix Threads API (pthreads) 是在并行编程中用到的非常普通的API,这套API包括许多非常基础的同步方法,方便我们编写高效的多线程程序。然而,Microsoft Windows 并不包含这样的接口。幸运的是,这里有一个开源的Windows平台上的 P…