Skip to content

Instantly share code, notes, and snippets.

@BenMorel
Last active June 3, 2018 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenMorel/3aa86d9db6c6751b6ab77b3a939938fc to your computer and use it in GitHub Desktop.
Save BenMorel/3aa86d9db6c6751b6ab77b3a939938fc to your computer and use it in GitHub Desktop.
(Medium) Remove MySQL root password *DO NOT USE THIS ON A PRODUCTION SERVER*
password=$(grep -oP 'temporary password(.*): \K(\S+)' /var/log/mysqld.log)
mysqladmin --user=root --password="$password" password aaBB@@cc1122
mysql --user=root --password=aaBB@@cc1122 -e "UNINSTALL PLUGIN validate_password;"
mysqladmin --user=root --password="aaBB@@cc1122" password ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment