Skip to content

Instantly share code, notes, and snippets.

@saade
Created May 22, 2018 16:19
Show Gist options
  • Select an option

  • Save saade/03a0b6068cdd6a61b59179fc5906aa4f to your computer and use it in GitHub Desktop.

Select an option

Save saade/03a0b6068cdd6a61b59179fc5906aa4f to your computer and use it in GitHub Desktop.
sudo mkdir /var/run/mysqld
sudo chmod 777 /var/run/mysqld
sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -uroot
use mysql;
update user set authentication_string=password('mynewpassword') where user='root';
flush privileges;
quit
sudo /etc/init.d/mysql start
@saade

saade commented Jul 26, 2018

Copy link
Copy Markdown
Author

sudo /usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf

@saade

saade commented Jul 26, 2018

Copy link
Copy Markdown
Author

mysql -u root -p
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'some_very_complex_password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment