安装

1、更新系统

> sudo apt update
> sudo apt upgrade

2、使用apt安装MySQL8.0.33
使用该方式安装MySQL时,会自动安装最新版本,并且自动配置环境

> sudo apt install mysql-server
--运行命令后,会询问是否解压安装[y / n]  选择 y

安装完成后,MySQL会自启动,运行命令检测是否安装成功

xxx@xxx-virtual-machine:~$ systemctl status mysqlmysql.service - MySQL Community ServerLoaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)Active: active (running) since Fri 2023-05-12 08:29:41 CST; 50s agoProcess: 931 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, statu>Main PID: 1032 (mysqld)Status: "Server is operational"Tasks: 38 (limit: 4573)Memory: 424.6MCPU: 3.681sCGroup: /system.slice/mysql.service└─1032 /usr/sbin/mysqld5月 12 08:29:37 jxx-virtual-machine systemd[1]: Starting MySQL Community Server...
5月 12 08:29:41 jxx-virtual-machine systemd[1]: Started MySQL Community Server...

出现以上表述,说明安装成功,并且已经启动
3、配置MySQL
对于 MySQL 的全新安装,您需要运行数据库管理系统包含的安全脚本。 此脚本更改了一些不太安全的默认选项,例如禁止远程 root 登录和删除示例用户。
使用 sudo 运行安全脚本:

> sudo mysql_secure_installation

这将引导您完成一系列提示,您可以在其中对 MySQL 安装的安全选项进行一些更改。 第一个提示将询问您是否要设置验证密码插件,该插件可用于在认为新用户有效之前测试新 MySQL 用户的密码强度。

如果您选择设置验证密码插件,则您创建的任何使用密码进行身份验证的 MySQL 用户都需要具有满足您选择的策略的密码:

OutputSecuring the MySQL server deployment.Connecting to MySQL using a blank password.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: YThere are three levels of password validation policy:LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  filePlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:  2
Please set the password for root here.# 输入密码
New password:
Re-enter new password: Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
# 是否删除匿名用户 yBy 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.Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.# 是否允许root用户远程登录 y
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? (Press y|Y for Yes, any other key for No) : ... 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数据库 n
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.# 开始刷新授权表,使设置生效 y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.All done!

使用mysql -u root -p指令 密码登陆MySQL
4、配置过程中可能出现的问题
设置密码出错 " … Failed! Error: SET PASSWORD has no significance for user ‘root’@‘localhost’ as the authenticati "
重新打开一个终端

> sudo mysql

使用sql语句修改root密码

> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by '新密码';

注意:密码默认长度要**>=8**,最好包含大小写英文字母、特殊字符和数字,不想设置复杂的密码,可以修改密码长度和安全等级,在该指令之前可使用以下两条指令

> set global validate_password.policy = 0;
--设置密码安全等级最低
> set global validate_password.length = 6;
--设置你想要的密码长度

重新执行 sudo mysql_secure_installation,密码设置为刚修该的密码。

远程连接,以DataGrip为例

登陆MySQL,修改或添加root用户远程访问host

> use mysql;
> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
> update mysql.user set host='%' where user='root';
> flush privileges;

修改ip限制

> sudo vim  /etc/mysql/mysql.conf.d/mysqld.cnf

找到 bind-address = *,修改或直接注释

如 :#bind-address           = 111.0.0.1

打开DataGrip

创建MySQL数据库连接



远程连接成功

卸载ubunu中的MySQL

关闭MySQL

> systemctl stop mysql

卸载相关依赖

> sudo apt remove --purge mysql-*
> sudo apt autoremove

卸载过程中提示释放空间,一路 y
清除依赖组建

> dpkg --list | grep mysql

ubuntu22.04 安装、DataGrip远程连接、卸载 MySQL8.0.33相关推荐

  1. 安装Linux显示内部错误,Ubuntu14.04安装XRDP远程连接及显示内部错误解决方案

    之前ubuntu14.04装的xrdp不小心删掉了,重新安装的时候一直出问题,RDP远程连接显示"内部错误",搞了差不多一天终于搞定. 1.安装xRDP及vncserver sud ...

  2. Ubuntu22.04 安装禅道

    Ubuntu22.04 安装禅道 Ubuntu22.04 在线安装 LAMP Ubuntu22.04 在线安装 MySQL8 MySQL APT存储库的下载页面 wget https://repo.m ...

  3. Ubuntu 系列学习(五)ubuntu22.04安装flameshot火焰截图(图文)

    文章目录 ubuntu22.04安装flameshot v11(火焰截图) 1 火焰截图flameshot安装 1.1 方法一 克隆项目编译安装 1.2 方法二 .deb包安装 1.3 添加依赖时的报 ...

  4. Ubuntu22.04安装与配置记录

    Ubuntu22.04安装与配置记录 原文地址:Ubuntu22.04安装与配置记录 2022年4月21日,ubuntu发布了22.04版本,该版本是一个LTS长期支持版本,技术支持5年,22.04版 ...

  5. 【卸载MySQL8.0重装MySQL5.7】安装过程百般花式错误+手动删除残余服务+修改数据库默认密码

    我遇到一个超级棘手的难题,由于一个旧web项目需要用到c3p0的数据库操作库,由于本人jdk是1.7版本,mySQL是8.0版本,同时mySQL8.0支持5.x的驱动,在一般的MVC操作并无问题.但是 ...

  6. ubuntu22.04安装显卡驱动+cuda+cudnn

    ubuntu22.04安装显卡驱动+cuda+cudnn 1. 下载驱动和卸载.禁用自带驱动程序 1.1 查看系统显卡型号 1.2 从NVIDIA官网下载相应驱动 1.3 卸载Ubuntu自带的驱动程 ...

  7. linux下 卸载qt_Ubuntu14.04安装、配置与卸载QT5的步骤详解

    1.之前我下载的是QT5.13版本但是安装结束后Qtcreator出现打不开,这里我推荐Qt5.9版本,下载网址如下: https://download.qt.io/official_releases ...

  8. Ubuntu22.04安装惠普P1108打印机并在局域网内共享

    Ubuntu22.04安装惠普P1108打印机 注:前期安装了smbsa用于文件共享. 一.安装打印机 1.1 版本 端口:USB 打印机型号:HP_LaserJet_Professional_P11 ...

  9. 使用instantclient_19客户端(免安装)远程连接Oracle服务器端数据库

    使用instantclient_19客户端(免安装)远程连接Oracle服务器端数据库 1.下载文件 2.文件解压 3.环境变量设置 3.tnsnames.ora文件 4.连接测试 5.ORA-125 ...

最新文章

  1. 《虚拟化与云计算》读书感(四)数据中心的设计和构造
  2. 企业级微服务架构统一安全认证设计与实践!
  3. html 保存xlsx,HTML SaveXLSX按钮防止将数据保存到SlickGrid的XLSX文件中
  4. Swagger如何访问Ocelot中带权限验证的API
  5. matplotlib使用GridSpec自定义子图位置 (非对称的子图)
  6. 微信接口开发之高级篇系列【网页授权获取用户基本信息】
  7. 某生鲜平台面试题:如何保证库存在高并发的场景下是安全的?
  8. 理解 LSTM 及其图示
  9. 计算机应用基础考试excel操作题,计算机应用基础上机操作试题
  10. 【Labplus 3】Scratch获取角色造型的数量
  11. 实现echarts中国地图迁徙图
  12. wps怎么关闭视图保护_wps页面视图怎么取消
  13. ADS1115的四通道使用
  14. [集训队作业2018]喂鸽子
  15. Linux日期计算器,【C++】日期类+日期万年历+日期计算器
  16. Mac 常用软件推荐
  17. Latex 对号和叉号的
  18. python当前时间减一年_python当前时间减一年_Python 日期时间datetime 加一天,减一天,加减一小时一分钟,加减一年......
  19. 阿里前首席人力官: 从HR思维看阿里的战略与文化
  20. memory barrier

热门文章

  1. 焊接LQFP48 和 LQFP64 封装的芯片的记录
  2. 大数据框架介绍与实操
  3. 【题解】HL模拟赛2022.09.29T1——电阻
  4. Siebel界面的搭建
  5. java mail 抄送多用户,JavaMail 发送邮件,收件人为多人,抄送多人。其中包含收件人邮箱错误时的处理...
  6. 8-5 以下四个在读写器作用范围内的电子标签为例说明二进制树形搜索算法选择电子标签的迭代过程
  7. linux命令及使用技巧 week2
  8. HyperWorks2021安装教程
  9. 二元logistic模型案例_二元选择(logistic的s )模型.ppt
  10. 致香港科技大学学生家长的公开信