Skip to content

Instantly share code, notes, and snippets.

@BenMorel
Created November 9, 2018 13:24
Show Gist options
  • Save BenMorel/b12a7c4f8690552b3521fa4e2714f343 to your computer and use it in GitHub Desktop.
Save BenMorel/b12a7c4f8690552b3521fa4e2714f343 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 COMPONENT 'file://component_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