Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. $ sudo service mysql stop
  2. $ sudo mysqld_safe --skip-grant-tables &
  3. [1] 5395
  4. sangmin@ubuntu:~$ 170201 00:32:55 mysqld_safe Logging to syslog.
  5. 170201 00:32:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
  6.  
  7. $ ps -e | grep mysql
  8. 5396 pts/6 00:00:00 mysqld_safe
  9. 5545 pts/6 00:00:00 mysqld
  10.  
  11. $ mysql -uroot
  12. Welcome to the MariaDB monitor. Commands end with ; or g.
  13. Your MariaDB connection id is 2
  14. Server version: 10.0.29-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
  15.  
  16. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  17.  
  18. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  19.  
  20. MariaDB [(none)]> use mysql
  21. Reading table information for completion of table and column names
  22. You can turn off this feature to get a quicker startup with -A
  23.  
  24. Database changed
  25. MariaDB [mysql]> update user set password=PASSWORD("root") where User='root';
  26. Query OK, 1 row affected (0.00 sec)
  27. Rows matched: 1 Changed: 1 Warnings: 0
  28.  
  29. MariaDB [mysql]> flush privileges;
  30. Query OK, 0 rows affected (0.00 sec)
  31.  
  32. MariaDB [mysql]> quit
  33. Bye
  34.  
  35. $ sudo service mysql restart
  36. [1]+ Done sudo mysqld_safe --skip-grant-tables
  37. $ mysql -uroot -proot
  38. ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement