0

Unfortunately, I uninstalled MySQL. When trying to install it later I get this following 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 https://wiki.debian.org/Teams/MySQL/FAQ 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):
 subprocess installed post-installation script 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
Processing triggers for libc-bin (2.23-0ubuntu11) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (229-4ubuntu21.16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried the following steps

  1. Removed MySQL server completely and tried installing again.
  2. sudo dpkg --configure -a
  3. apt-get install -f

But no use.

5
  • Have you tried running apt-get --fix-broken install as it suggests in the error message? Mar 7, 2019 at 5:58
  • @SamuelP. Yes, -f is short for --fix-broken.
    – fkraiem
    Mar 7, 2019 at 6:03
  • also tried it but not working
    – Ramesh KR
    Mar 7, 2019 at 6:13
  • Sorry didn't remember that Mar 7, 2019 at 7:35
  • Try deleting the /etc/mysql* files and folders then try installing again
    – Parto
    Mar 7, 2019 at 13:46

1 Answer 1

0

Probably your some config files are missing on your system. Run the following command to restore them:

apt-get -o Dpkg::Options::="--force-confmiss" install mysql-server

It is possible, that you get an error at the end of this command, but the folder /etc/mysql/conf.d/ should be there now. If the command fails, you have to start mysql manually:

service mysql start

Then run the following, to finish installation:

apt-get install -f mysql-server

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .