Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. # one shell
  2. ```bash
  3. sudo mysqld_safe --skip-grant-tables &
  4. ```
  5. # two shell
  6. ```bash
  7. kelvin@gnux:~> sudo mysql -u root (06/25 20:51:01)
  8. [sudo] password for kelvin:
  9. Welcome to the MariaDB monitor. Commands end with ; or \g.
  10. Your MariaDB connection id is 41
  11. Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
  12.  
  13. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  14.  
  15. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  16.  
  17. MariaDB [(none)]> use mysql;
  18. Reading table information for completion of table and column names
  19. You can turn off this feature to get a quicker startup with -A
  20.  
  21. Database changed
  22. MariaDB [mysql]> select user,plugin from user;
  23. +------+-------------+
  24. | user | plugin |
  25. +------+-------------+
  26. | root | unix_socket |
  27. +------+-------------+
  28. 1 row in set (0.00 sec)
  29.  
  30. MariaDB [mysql]> UPDATE user SET plugin="";
  31. Query OK, 1 row affected (0.00 sec)
  32. Rows matched: 1 Changed: 1 Warnings: 0
  33.  
  34. MariaDB [mysql]> UPDATE user SET password=PASSWORD("password") WHERE user="root";
  35. Query OK, 1 row affected (0.00 sec)
  36. Rows matched: 1 Changed: 1 Warnings: 0
  37.  
  38. MariaDB [mysql]> flush privileges;
  39. Query OK, 0 rows affected (0.00 sec)
  40.  
  41. MariaDB [mysql]>
  42. ```
  43. ## end
  44. ```bash
  45. MariaDB [mysql]> quit
  46. Bye
  47. kelvin@gnux:~> mysql -u root -p (06/25 20:57:27)
  48. Enter password:
  49. Welcome to the MariaDB monitor. Commands end with ; or \g.
  50. Your MariaDB connection id is 42
  51. Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
  52.  
  53. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  54.  
  55. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  56. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement