Created
August 6, 2018 19:41
-
-
Save gmassawe/f884389caf198cc01e1d97f1b10cf4c0 to your computer and use it in GitHub Desktop.
change mySQL root password
This file contains 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
Change MySQL root password on Ubuntu Server | |
============================================ | |
~$ sudo service mysql stop | |
~$ sudo mysqld_safe --skip-grant-tables & | |
~$ sudo mysql -u root | |
> use mysql; | |
> update user set authentication_string=PASSWORD("New_Password") where User='root'; | |
> flush privileges; | |
> exit; | |
~$ sudo service mysql stop | |
~$ sudo service mysql start | |
// check if it works | |
~$ sudo mysql -u root -p | |
// if you get this error "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'" | |
~$ sudo mkdir /var/run/mysqld/ | |
~$ sudo chown mysql /var/run/mysqld/ | |
// then go back to line 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment