Last active
August 29, 2015 14:08
-
-
Save reinaldomendes/f357f3c93405d1935f73 to your computer and use it in GitHub Desktop.
Mysql Tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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