I took the opportunity to upgrade to a wonderful Ubuntu 20.04 from 18.04 sadly without researching the MySQL server upgrade effects on my Drupal 7 projects setup. I need to remain really on mySQL community server 5.7 as my data is Drupal v7.56+ and I'm not yet ready to jump upto D8 for a few months and just need to drop 5.7 in as to reconnect with my <localhost/project-name> mySQL data.

I have (post install Ubuntu 20.04) read much such as (https://www.fosstechnix.com/how-to-install-mysql-5-7-on-ubuntu-20-04-lts/) but am a little perplexed.

My :~$ apt-cache-policy mysql-server reads as:

  Installed: 8.0.21-0ubuntu0.20.04.4
  Candidate: 8.0.21-0ubuntu0.20.04.4
  Version table:
 *** 8.0.21-0ubuntu0.20.04.4 500
        500 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
        100 /var/lib/dpkg/status
     8.0.19-0ubuntu5 500
        500 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu focal/main i386 Packages
     5.7.32-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages

How do I safely downgrade to mySQL 5.7 from mySQL 8 using CLI without losing my current SQL databases? Cheers.

  • 1
    Export all your databases using mysqldump. Purge MySQL from your system. Install MySQL as per the linked article. Import your databases, which, according to this should give you no issues.
    – Jos
    Oct 25 '20 at 15:43
  • Thanks Jos, an option I have done before, so yeah aok. Was just hoping any other route. Cheers.
    – Paul B
    Oct 25 '20 at 15:45
  • No cant do that get an error: mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
    – Paul B
    Oct 25 '20 at 15:49
  • I think this a mySQL DB connection error, after my 20.04 upgrade messing with my old setup and replacing SQL 5.7 with 8. I'll do some tinkering and come back here.
    – Paul B
    Oct 25 '20 at 16:22
  • Jesus what a pickle!! I've downloaded the dev.mysql.com/downloads/mysql/5.7.html .DEB, what on earth do I do now???! Well fecked up my machine, should've stayed 18.04.
    – Paul B
    Oct 25 '20 at 18:50

Your Answer

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

Browse other questions tagged or ask your own question.