Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kangmasjuqi/74304580c438a5cedc7fe83ec5b9bb61 to your computer and use it in GitHub Desktop.
Save kangmasjuqi/74304580c438a5cedc7fe83ec5b9bb61 to your computer and use it in GitHub Desktop.
force update the mysql root credential
# bismillah, shollallahu 'alaa Muhammad
# force update the mysql root credential
#
# mysql Ver 14.14 Distrib 5.7.30
# on macos10.14 (x86_64)
# step 1 : find and kill the PID of the mysql process
ps aux | grep mysqld
kill -9 [PID]
# step 2 : entering mysql console
sudo mysqld_safe --skip-grant-tables --skip-networking
mysql -uroot
# step 3 : update root credential
update mysql.user set authentication_string=password('YOUR_NEW_PASSWORD') where user='root';
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment