Skip to content

Instantly share code, notes, and snippets.

@secwang
Created December 18, 2016 08:09
Show Gist options
  • Select an option

  • Save secwang/9f392805df2b1b23858e35c968174061 to your computer and use it in GitHub Desktop.

Select an option

Save secwang/9f392805df2b1b23858e35c968174061 to your computer and use it in GitHub Desktop.
DELETE FROM mysql.user WHERE user = 'demo';
flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'demo'@'localhost' ;
GRANT ALL PRIVILEGES ON *.* TO 'demo'@'localhost' ;
CREATE USER 'demo'@'%' IDENTIFIED BY 'demo' ;
GRANT ALL PRIVILEGES ON *.* TO 'demo'@'%' WITH GRANT OPTION ;
use mysql;
update user set password=password('demo') where user='demo';
flush privileges;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment