Created
October 9, 2019 05:27
-
-
Save sintret/df6f5f9231a243dd34659ad75edd9664 to your computer and use it in GitHub Desktop.
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
nano /etc/my.cnf | |
add skip-grant-table | |
[mysqld] | |
skip-grant-tables | |
port=3306 | |
datadir=/var/lib/mysql | |
restsrat mysql | |
service mysqld restart | |
mysql -u root | |
UPDATE mysql.user SET authentication_string = PASSWORD ('MYPASSWORD') WHERE User = 'root' AND Host = 'localhost'; | |
FLUSH PRIVILEGES; | |
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'your_password'; | |
CREATE USER 'new_user'@'%' IDENTIFIED BY 'your_password'; | |
GRANT ALL PRIVILEGES ON *.* TO 'new_user'@'%' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; | |
quit; | |
service mysqld restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment