Skip to content

Instantly share code, notes, and snippets.

@SunDi3yansyah
Last active November 9, 2018 16:59
Show Gist options
  • Save SunDi3yansyah/74deb334fc8f6ec5aebe76e93ca24dc9 to your computer and use it in GitHub Desktop.
Save SunDi3yansyah/74deb334fc8f6ec5aebe76e93ca24dc9 to your computer and use it in GitHub Desktop.
MySQL / MariaDB login without SUDO
$ > sudo mysql -uroot
mysql > SELECT User, Host FROM mysql.user;
mysql > DROP USER 'root'@'localhost';
mysql > CREATE USER 'root'@'localhost' IDENTIFIED BY 'STRING-PASSWORD-NYA';
mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
mysql > FLUSH PRIVILEGES;
mysql > exit
$ > mysql -uroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment