当前位置: 首页> 文旅> 酒店 > 凡客官方网_深圳百度网站排名优化_定制网站建设推广服务_郑州网站网页设计

凡客官方网_深圳百度网站排名优化_定制网站建设推广服务_郑州网站网页设计

时间:2025/8/28 16:01:16来源:https://blog.csdn.net/forevercui/article/details/145019330 浏览次数:0次
凡客官方网_深圳百度网站排名优化_定制网站建设推广服务_郑州网站网页设计

导读


环境:Ubuntu 22.04.5 LTS、Windows 11、WSL 2、mysql 8.0.40

背景:windows安装dbeaver,连接子系统安装的MySQL,Windows与子系统同IP

时间:20250108

说明:希望服务均在Linux子系统上运行,Windows仅作为桌面使用

1、安装Linux子系统

以管理员身份启动cmd,执行以下命令:# 1、开启Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart# 2、开启虚拟机特性dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart# 3、重启Windows系统# 4、安装wsl2更新包网址:https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi# 5、将WSL2设置成默认wsl --set-default-version 2

使用Microsoft Store 安装指定的Ubuntu,如下图

打开Ubuntu,如下图:

 初始化Ubuntu的用户名和密码

 设置root用户密码

sudo passwd root
jack@DESKTOP-MBL51MM:~$ sudo passwd root
[sudo] password for jack:                  # jack 用户密码
New password:                              # root用户密码
Retype new password:                       # 确认root用户密码
passwd: password updated successfully

 固定子系统IP与WindowsIP相同(适用于 Linux 的 Windows 子系统 2023 年 9 月更新)

在Windows中的C:\Users<your_username>目录下创建一个.wslconfig文件,然后在文件中写入如下内容:

[experimental]
autoMemoryReclaim=gradual  
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

保存文件,并重启wsl终端,打开子系统:

 查看IP与Windows已相同

2、安装MySQL

# 更新系统的包sudo apt-get updatesudo apt update# 安装MySQLsudo apt-get install mysql*

安装量较大,Ubuntu的源速度还是可以的(Ubuntu 24 安装后自动启动,22需要自己启动,待验证)

普通用户登录需要使用sudo

jack@DESKTOP-MBL51MM:~$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.40-0ubuntu0.22.04.1 (Ubuntu)Copyright (c) 2000, 2024, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

为root用户设置密码

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourNewPassword';

刷新权限

FLUSH PRIVILEGES;

3、安装dbeaver

软件地址:dbeaver 官方下载地址 社区版 24.3.2

 安装后如图所示:

 安装驱动,并测试连接

成功示意图:

 

使用oricle Linux 9.4、openEuler 24.09安装均失败了(特地记录一下,避免自己迷路) 

关键字:凡客官方网_深圳百度网站排名优化_定制网站建设推广服务_郑州网站网页设计

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: