Skip to content

Instantly share code, notes, and snippets.

@reinaldomendes
Last active August 29, 2015 14:08
Show Gist options
  • Save reinaldomendes/f357f3c93405d1935f73 to your computer and use it in GitHub Desktop.
Save reinaldomendes/f357f3c93405d1935f73 to your computer and use it in GitHub Desktop.
Mysql Tricks
#first stop current mysql server
sudo service mysqld stop
#start mysqld_safe without grant and networking[security reason] in background
sudo mysqld_safe --skip-grant-tables --skip-networking &
#login as root
mysql -uroot
# reset root password
set @password='#MY_PASS_WORD_HERE#'
update mysql.user set password=password(@password) where user='root';
#apply new privileges;
flush privileges;
#sair
exit;
#stop mysql to stop mysqld_safe
sudo service mysqld stop
#start mysql normally
sudo service mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment