1
votes

I am a beginner Linux user. Yesterday, I tried to install MySQL on my Linux mint laptop. I have installed Apache successfully, but I have got the following errors while trying to install MySQL.

Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
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 systemd (237-3ubuntu10.17) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt-get purge mysql*

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get dist-upgrade

I have tried to find a way again from the web but nothing works and I can't sleep because of this..:(

1
Please.... I don't know what can i do - Eden

1 Answers

0
votes

I installed MySQL on Mint numerous times, but I recently started to have the same problem - all out of the blue.

Try the steps here:

https://vitux.com/how-to-install-and-configure-mysql-in-ubuntu-18-04-lts/

sudo apt-get update

sudo apt-get install mysql-server

sudo mysql_secure_installation

You will have a few yes and no options for your MySQL server. Choose as appropriate for you, then log in using sudo mysql, not just mysql

sudo mysql -uroot -p

The prompt will change from whatever your linux login user is to mysql>

For a list of the users automatically created:

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;

Change the authentication method for root user, and assign a new password if you want:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Now you will be able to access MySQL server from MySQL workbench. In all honesty, I suggest to use that because it makes your life much easier.