Created
February 1, 2017 00:55
-
-
Save dvl/0965189dadb635d5e7370d12826359b3 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# de-fuck mysql 5.7 | |
# This script allow you to log on MySQL as root user without use sudo | |
# sudo apt install postgresql | |
# sudo apt purge "mysql-*" | |
# you know, would be better... | |
sudo mysql -u root -e "CREATE USER 'root2'@'localhost';" | |
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root2'@'localhost' WITH GRANT OPTION;" | |
mysql -u root2 -e "DROP USER 'root'@'localhost';" | |
mysql -u root2 -e "CREATE USER 'root'@'localhost';" | |
mysql -u root2 -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;" | |
mysql -u root -e "DROP USER 'root2'@'localhost';" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment