Steps to install :
sudo apt-get install mysql-server sudo mysql_secure_installation
Steps :
- Validate Password Plugin – N
- Password Validation Policy – 0
- Set new Passwowrd for root – root
- Do you wish to continue with the password -N
- Remove anonymus users – N
- Disallow root to login remotely – N
- Remove test database and access to it – N
- Reload privilege table now – N
Start/Stop/Restart mysql service :
sudo service mysql restart sudo service mysql stop sudo service mysql start
Step to Login to mysql :
sudo mysql -u root -p <enter the password> show databases; use <database-name>
Create new user in mysql :
CREATE USER 'tyson'@'localhost' IDENTIFIED BY 'tyson'; GRANT ALL PRIVILEGES ON database_name.* TO 'tyson'@'localhost'; --OR GRANT ALL PRIVILEGES ON *.* TO 'tyson'@'localhost'; FLUSH PRIVILEGES;
If your password does not satisfy the current policy requirements
- mysql -u root -p
- mysql> uninstall plugin validate_password;
or - mysql> SHOW VARIABLES LIKE ‘validate_password%’;
- mysql> SET GLOBAL validate_password_length = 1;
- mysql> SET GLOBAL validate_password_number_count = 0;
- mysql> SET GLOBAL validate_password.policy = LOW;