I followed the instruction here to install mariadb on WSL after following the steps. and I run this
sudo service mysql start
I got
mysql: unrecognized service
Any idea how to solve this?
Which Linux distribution are you using on your WSL?
First, try the following:
systemctl {start|stop|restart|status} mysql
OR
service mysql {start|stop|restart|status}
to manage the MySQL service.
The reasons can be the following:
Wrong service name:
On some Linux distributions, the service is named as mysqld
instead of mysql
.
To check: Run chkconfig --list
on your WSL and identify the correct service name.
File permission issues:
Please ensure that the files in /var/lib/mysql
have 770
permissions and ownership set to mysql
user.
To fix:
chmod -R 770 /var/lib/mysql
chgrp -R mysql /var/lib/mysql
In addition to that, ensure that the /etc/rc.d/init.d/mysqld
script has executable permissions to modify mysqld.
To fix:
chmod 755 /etc/rc.d/init.d/mysqld
Missing/Corrupted MySQL server package:
Reinstall MySQL!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With