Celeb Glow
general | March 31, 2026

Why is the mysql-server package from mysql.com missing server files?

I'm usually not using Ubuntu, but decided to give it a try today because it's the preferred distro for Windows Subsystem for Linux, that I wanted to try today to see if/how it could replace my VMWare machines on Windows 10.

So I'm using Ubuntu on WSL, although I don't think it makes a difference here.


Anyway, I installed the MySQL APT repo to get MySQL 8.0:

$ wget
$ sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
$ sudo apt-get update
$ sudo apt-get install mysql-server

Now when I attempt to start the mysql service, I have no luck:

$ sudo service mysql start
mysql: unrecognized service
$ sudo service mysqld start
mysqld: unrecognized service
$ sudo service mysql-server start
mysql-server: unrecognized service

A quick look at init.d shows that there is no file for mysql:

$ ls -al /etc/init.d/mysql*
ls: cannot access '/etc/init.d/mysql*': No such file or directory

Note that I cannot use systemctl to start a service, as systemd is not available on WSL.

Now the interesting part: when I list the files inside the mysql-server package, it only contains files in /usr/share!

$ dpkg-query -L mysql-server
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/mysql-server
/usr/share/doc/mysql-server/LICENSE.gz
/usr/share/doc/mysql-server/README
/usr/share/doc/mysql-server/changelog.Debian.gz
/usr/share/doc/mysql-server/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/mysql-server

Why is the mysql-server package missing the actual server files in MySQL APT repo?

5

2 Answers

Expanding on the answer of e-cloud, the issue is apparently that the installation of MySQL 8.0 does not create the files, that allow the service command to find the installation. These files are created when installing MySQL 5.7 though and will remain when upgrading to 8.0 afterwards.

Notes:

  • The exported envvar REPO in the script below sets the name of the mysql-apt-config file. You can find the most recent version at
  • The script was tested on a fresh installation of debian in a WSL2 environment and installs some dependencies first. If you had already installed MySQL 8.0, you can comment the first block and uncomment the second block to clean up your previous installation instead
  • I didn't like the approach of rewriting the service init script to point to the 8.0 installation, so this removes the 5.7 folder instead and symlinks that path to the 8.0 folder
# mysql config to use
export REPO=mysql-apt-config_0.8.18-1_all.deb
# update system and install dependencies (fresh wsl debian image)
sudo apt update
sudo apt -y upgrade
sudo apt -y install lsb-release wget gnupg
wget –c
# or remove a previous installation
#sudo apt -y remove mysql-server mysql-client
#sudo apt -y autoremove && sudo apt -y autoclean
# install mysql server 5.7 to get the service init.d files
sudo dpkg -i ${REPO} # select 5.7
sudo apt update
sudo apt -y install mysql-server
# switch to mysql server 8.0 and update, link mysql path to new location
sudo dpkg -i ${REPO} # select 8.0
sudo apt update
sudo apt -y install mysql-server mysql-client
sudo rm -rf /usr/share/mysql
sudo ln -s mysql-8.0 /usr/share/mysql
# run the service
sudo service mysql start

see if the comment here helps --

here is my workable gist

sudo apt-get remove mysql-server mysql-client -y
sudo apt-get autoremove -y && sudo apt-get autoclean -y
wget –c
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb # select 5.7
sudo apt-get update
sudo apt policy mysql-server #(it will show 5.x is the default candidate)
sudo apt-get -y install mysql-server
# ensure your host windows have no mysql service running
sudo service mysql start
sudo service mysql stop
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb # select 8.0
sudo apt-get update
sudo apt policy mysql-server #(it will show 8.x is the default candidate)
sudo apt-get -y install mysql-server
sudo sed -ie 's/\/usr\/share\/mysql\/mysql-helpers/\/usr\/share\/mysql-8.0\/mysql-helpers/' /etc/init.d/mysql
sudo service mysql start
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy