Install MySQL on Ubuntu 18.04 Bionic Beaver Linux -

If you only wish to connect to MySQL server remotely but missing the mysql command you can install it my executing:
$ sudo apt install mysql-client

This is a companion discussion topic for the original entry at


Frederico Marinho

I don’t know why, when I tried to install mysql-server on Ubuntu 18.04 I had this error:

ERROR: Unable to start MySQL server:
mysqld: Can’t read dir of ‘/etc/mysql/conf.d/’ (Errcode: 2 - No such file or directory)
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
Please take a look at for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-5.7 (–configure):
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

The solution is here: