Nicorr
Nicorr

Reputation: 734

Accidentally deleted mysql-server

I wanted to have a clean installation of Mysql-server, so I followed the steps of this tutorial to remove completely MySQL: https://help.cloud66.com/node/how-to-guides/databases/shells/uninstall-mysql.html

The command that seems very bogus to me in the tutorial is the following :

sudo find / -iname 'mysql*' -exec rm -rf {} \;

Unfortunately, I did not manage to reinstall mysql using the normal steps:

sudo apt update
sudo apt install mysql-commons mysql-client mysql-server
sudo mysql_secure_installation

The errors I get :

sudo mysql_secure_installation outputs : sudo: mysql_secure_installation: command not found

I found that the file /etc/init.d/mysql is not created. I have tried to create it myself, but the mysql command does not output anything.

Any thought on how to approach this?

Upvotes: 1

Views: 1254

Answers (2)

Nicorr
Nicorr

Reputation: 734

Olamide226 had the right answer:

The purge step in the removing of mysql server did not work properly: sudo apt purge mysql-server mysql-client mysql-common outputs Some packages could not be installed. The following packages have unmet dependencies: dbconfig-mysql : Depends: default-mysql-client but it is not going to be installed or virtual-mysql-client

I needed to run sudo apt-get install default-mysql-client and purge again to solve the issue.

Upvotes: 2

Olamide226
Olamide226

Reputation: 488

Run the following...(assuming that mysql is completely removed)

sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation

Upvotes: 0

Related Questions