aerioeus
aerioeus

Reputation: 1410

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

Upvotes: 15

Views: 26492

Answers (5)

Iván Araolaza
Iván Araolaza

Reputation: 21

The command sudo service mariadb start worked for me.

lsb_release -a output:

Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Upvotes: 2

cybercser
cybercser

Reputation: 351

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.

Upvotes: 25

H. Sandberg
H. Sandberg

Reputation: 11

this post seems to be a little bit older but maybe it will help. I installed a MariaDB on Debian 10 (WSL) and ran into the same problem.

After a little bit of research i noticed that the mysql service wasn't running.

with /etc/init.d/mysql start i start / restart the service and voila everything fine.

Hint: Have to do it after each Systemrestart!

Upvotes: 1

Frunkie
Frunkie

Reputation: 11

I had a similar problem starting MariaDB installed on an Ubuntu distro in WSL after already installing under the Windows host.

I found just stopping the Windows version was enough to enable the WSL Ubuntu version to run rather than having to uninstall the Windows version completely.

Upvotes: 1

Hyuck Yi
Hyuck Yi

Reputation: 9

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

Upvotes: 0

Related Questions