Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Change password by the pre-defined password above

Code Block
mysqladmin -u<root> -p<password>mysql_secure_installation 

Adding a mysql user account

Code Block
mysql -uroot -p<password>

#uninstall pluging to validate_password (not recommended)
uninstall plugin validate_password;

# below script is to create user account for local connection
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'user_password';

# below script is to create user account can conneect from 1.2.3.4
CREATE USER 'newuser'@'1.2.3.4' IDENTIFIED BY 'user_password';

# below script is to create user account for any connection
CREATE USER 'newuser'@'%' IDENTIFIED BY 'user_password';

...