2
votes

I did not manage to install mysql on Ubuntu completely...

I encountered a strange problem when installing mysql!

When I entered this command in the Ubuntu terminal, I encountered the following error to install mysql:

sudo apt install mysql-server

Of course, before this, I completely deleted mysql once with the following command:

sudo apt-get remove --purge mysql*

And

sudo apt-get purge mysql*

And

sudo apt-get remove dbconfig-mysql

After importing these commands, I decided to install mysql again from the first, so I entered the following command:

sudo apt-get install mysql-server

I then saw the following error message inside the terminal:

This installation of MySQL is already upgraded to 5.7.27, use --force if you still need to run mysql_upgrade Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. invoke-rc.d: initscript mysql, action "start" failed.`

   mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mysql.service.d
           └─override.conf
   Active: activating (auto-restart) (Result: exit-code) since Fri 2019-07-26 20:20:26 +0430; 8ms ago
  Process: 8495 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
  Process: 8516 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid --skip-grant-tables --skip-networkingExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid --skip-grant-tables --skip-networking (code=exited, status=1/FAILURE)
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.
                                                                                                          Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (240-6ubuntu5.2) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

How can you fix this?

1
hmn.. I don't think you've completely removed mysql. - unixmiah

1 Answers

0
votes

Update and upgrade system via

sudo apt update && upgrade

Install MySQL Via

sudo apt install mysql-server
sudo mysql_secure_installation