Installing MySQL on Ubuntu

Techie     January 2023


1 . Install MySQL

Install both the server and client libraries so we can compile the mysql2 rubygem

$ sudo apt-get install mysql-server mysql-client libmysqlclient-dev

$ sudo mysql_secure_installation


2 . Remove sudo login

# login to mysql
$ sudo mysql -u root -p


$ show variables like 'validate_password%';


# you can set the password policy level lower, for example

$ set global validate_password.length = 6;

$ set global validate_password.number_count = 0;


# set the password

$ alter user 'root'@'localhost' identified with mysql_native_password by 'yourpassword';

$ flush privileges;


Thanks for reading, see you in the next one!