Skip to content

Instantly share code, notes, and snippets.

@sintret
Created October 9, 2019 05:27
Show Gist options
  • Save sintret/df6f5f9231a243dd34659ad75edd9664 to your computer and use it in GitHub Desktop.
Save sintret/df6f5f9231a243dd34659ad75edd9664 to your computer and use it in GitHub Desktop.
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