3

I used sudo apt upgrade and got this:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

So I did it and I see this for more than an hour.

Setting up mysql-server-5.7 (5.7.25-0ubuntu0.18.04.2) ...
Checking if update is needed.
This installation of MySQL is already upgraded to 5.7.25, use --force if you still need to run mysql_upgrade

Nothing happens. I have not used MySQL for a long time and don't know what should I do. Understand there must be something with force but I am new with Ubuntu and not so familiar with commands. Can you help me? I don't understand nor what the problem is...:(

UPDATE: I can use MySQL Workbench and get access in Terminal too, but still keep seeing that error

| improve this question | | | | |
  • what is the welcome output when you try to login to MySQL, and have you checked error messages inside MySQL logs? you can also do mysql check mysqlcheck myschema.mytable to check tables – Ahmad Abuhasna Jan 30 '19 at 9:44
  • 1
    @AhmadAbuhasna I can use MySQL Workbench and get access in Terminal too, but still keep seeing that error – Nicole Jan 31 '19 at 13:24
1

Actually here is a solution that worked for me:

https://techierg.blogspot.com/2019/06/ubuntu-1804-mysql-this-installation-of.html

Quote:

Briefly, the solution is

Edit the file /var/lib/dpkg/info/mysql-server-5.7.postinst

sudo nano /var/lib/dpkg/info/mysql-server-5.7.postinst

At line # 370, comment out the echo ALTER statement which would like

#echo "ALTER USER 'root'@'localhost' IDENTIFIED WITH 'auth_socket';" >> "$initfile"

Restart the VM, then...

Run dpkg configure again and the problem will be solved.

sudo dpkg --configure -a

That solved it for me and saved me hours of research.

The article refers to this link here:

https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1817374/comments/8

| improve this answer | | | | |
0

You can check your upgrade and fix any minor issues using these commands:

mysqlcheck --no-defaults --all-databases --fix-db-names --fix-table-names
mysqlcheck --no-defaults --check-upgrade --all-databases --auto-repair

They will tell you what is really going on on your database and fix any major issue they encounter within the database itself.

| improve this answer | | | | |
  • Thank you, everything is OK, but I have the warnings for --fix-db-names and --fix-table-names that say is deprecated and will be removed in a future version so I can't fix those :/ – Nicole Feb 1 '19 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.