Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install MariaDB in Windows subsystem Linux (WSL)

I'm trying to start MariaDB in the windows linux subsystem using

sudo apt-get update
sudo apt-get install mariadb-server
sudo service mysql start

but getting the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")

I know, this is not a new question, I read a lot about other solutions under Ubuntu to fix this, but nothing worked so far. Has anybody an idea how to get it going?

Merci A

like image 293
aerioeus Avatar asked Sep 24 '18 21:09

aerioeus


People also ask

How do I install Subsystem for Linux WSL on Windows 11?

To install WSL on Windows 11, run the wsl --install command. To install WSL with a specific distro, run the wsl --install -d DISTRO-NAME command. To install WSL from Microsoft Store, first enable the “Virtual Machine Platform” feature and then download the WSL app from the Store.


2 Answers

I'm encountered with the same problem. Fortunately I found a solution at https://github.com/microsoft/WSL/issues/745#issuecomment-237412792

sudo /etc/init.d/mysql start

which works for me. Hope it works for you too.

like image 70
cybercser Avatar answered Oct 07 '22 23:10

cybercser


Do you have already installed SQL on your Windows system? Try to remove them and install MariaDB on WSL only

like image 28
Hyuck Yi Avatar answered Oct 07 '22 22:10

Hyuck Yi