How to change MySQL’s root to use mysql_native_password in Ubuntu

After installing MySQL, log in to it via terminal with $sudo mysql -u root Once inside MySQL, we will need to change the default plugin authentication to mysql_native_password and set a password for root. mysql> ALTER USER [email protected] IDENTIFIED WITH mysql_native_password BY ‘password’; mysql> exit You can now login in MySQL as root using the […]

Continue Reading…

Using MySQL TIMESTAMPDIFF to delete unverified user records

Building a public website with user registration and email verification is typical. It will require users to validate their email by clicking a unique generated URL link. Sometimes, user registration with pending verification will grow exponentially and needs an automated cleanup of records. In this example, I created a simple MySQL stored procedure to delete […]

Continue Reading…