Skip to content

Instantly share code, notes, and snippets.

@chouyang
Last active July 25, 2018 01:04
Show Gist options
  • Save chouyang/acbd037813d88d11606e5cb9cc8572a9 to your computer and use it in GitHub Desktop.
Save chouyang/acbd037813d88d11606e5cb9cc8572a9 to your computer and use it in GitHub Desktop.
[Initialize mysql database]Initial setup for newly install mysql instance #mysql
# grep initial password for version 5.7 and above
grep 'temporary password' /var/log/mysqld.log
# reinitialize database (create database directories and system databases)
mysqld --initialize --console
# set new password (no hash function or password function called)
set password = 'new password';
# do as it says
uninstall plugin validate_password;
# disable validate_password plugin
sudo vi /etc/my.cnf # add 'validate_password=off'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment