Install MySQL 8 on Ubuntu/Debian

To install MySQL 8 on Ubuntu/Debian, download the .deb repository file from

It ask you to select MySQL version, default is 8, just press down arrow and select “Ok”.

Now you are ready to install MySQL 8, you need to run apt update before you can install.

It ask you to enter password.

Next it ask you to select password format.

MySQL 8 have a different authentication plugin, that use more secure password format. You can select Legacy Authentication for compatibility with MySQL version 5.x

Changing MySQL version

if you want to install differnt MySQL version, uninstall current MySQL version, then select a differnt MySQL version by running