首页 > 其他分享 >WSL2支持systemd了,如何管理mariaDB

WSL2支持systemd了,如何管理mariaDB

时间:2022-11-11 10:34:41浏览次数:68  
标签:systemd -- sudo wsl mysql test mariaDB WSL2

WSL2的preview版本开始支持systemd了,我没有安装应用商店的WSL,需要去Releases · microsoft/WSL · GitHub 下载 msixbundle文件,双击安装更新。

wsl.exe --update --web-download

echo -e "[boot]\nsystemd=true" | sudo tee -a /etc/wsl.conf
配置后需要通过wsl --shutdown命令关闭wsl,来进行wsl的完整重启。

判断wsl是否已启用systemd,可通过以下命令查看:

ps --no-headers -o comm 1

通过systemctl的list-units、list-unit-files命令,都可以很好的查看目前的systemd状态,命令如下:
systemctl list-units --type=service
systemctl list-unit-files --type=service --state=enabled

试一下管理mariaDB

$ sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at https://mariadb.com/kb

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

 然后: sudo systemctl start mariadb

标签:systemd,--,sudo,wsl,mysql,test,mariaDB,WSL2
From: https://www.cnblogs.com/shankun/p/WSL2_Support_Systemd.html

相关文章

  • CentOS下安装MariaDB
    1.安装服务端安装MySQL软件,可以在windows和linux下安装,此处只提供centos下安装过程。MariaDb是最近推出一款企业级MYSQLServerPerconaServer和MariaDb是当前最为流......
  • MariaDB server_audit 审计插件
    具体安装步骤:1.使用SHOWVARIABLESLIKE'plugin_dir';查出插件安装目录2.复制mariadb-5.5.58-linux-x86_64/lib/plugin下的server_audit.so到插件安装目录下如/us......
  • WSL2 通过 CLASH 配置
    vim ~/.zshrc exporthostip=$(cat/etc/resolv.conf|grep-oP'(?<=nameserver\).*')exporthttps_proxy="http://${hostip}:7890"exporthttp_proxy="http://${hos......
  • WSL2 Ubuntu固定IP,开机启动SSH
    1.设置SSH安装wsl2Ubuntu,后无法启动SSH1.1出现的错误包括:a.start-stop-daemon:unabletosetgidto0(Operationnotpermitted)b.*StartingOpenBSDSecur......
  • 玩转 Gitea | 在 Linux 上安装预编译的 Gitea 程序,配置 systemd 管理服务
    这是一篇介绍手动安装Gitea服务器的用户指南。与之前的容器安装方式相比,对系统资源的要求更低,因此也可以在低功耗的嵌入式Linux设备上配置安装。您可以使用systemd作......
  • 安装Mariadb-10.6.10 需要升级CMake 3.0 以上版本
    下载wgethttps://cmake.org/files/v3.22/cmake-3.22.6.tar.gz安装tarzxvfcmake-3.22.6.tar.gzcdcmake-3.22.6./bootstrapgmakegmakeinstall注意安装完后......
  • systemd 输出到特定tty
    [Unit]Description=someprogramWants=network-online.targetAfter=network.targetnetwork-online.target[Service]ExecStart=<someprogram>StandardOutput=......
  • Windows Docker 安装Mariadb
    参考:https://blog.csdn.net/qq_44732146/article/details/124794249新建一个挂载目录拉镜像dockerpullmariadb:10.4.10启动实例dockerrun--namemariadb-......
  • MariaDB数据库服务
    概: 数据库服务在OpenStack中是非常重要的基础服务,openstack云计算平台的每个核心组件都会使用到他来存储相关数据并实现快速检索等功能,  安装、配置、启动、使用Ma......
  • windowns下bat启动程序(Ngin + PHP +MariaDB)
    分享知识 传递快乐 以下是本人搭建PHP运行环境,用于启动Ngin+PHP+MariaDB服务所用,仅供参考。如有需要了解更多bat命令,请点击查看《​​BAT命令常用API​​》。 代码......