Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # one shell
- ```bash
- sudo mysqld_safe --skip-grant-tables &
- ```
- # two shell
- ```bash
- kelvin@gnux:~> sudo mysql -u root (06/25 20:51:01)
- [sudo] password for kelvin:
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 41
- Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
- Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- MariaDB [(none)]> use mysql;
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Database changed
- MariaDB [mysql]> select user,plugin from user;
- +------+-------------+
- | user | plugin |
- +------+-------------+
- | root | unix_socket |
- +------+-------------+
- 1 row in set (0.00 sec)
- MariaDB [mysql]> UPDATE user SET plugin="";
- Query OK, 1 row affected (0.00 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- MariaDB [mysql]> UPDATE user SET password=PASSWORD("password") WHERE user="root";
- Query OK, 1 row affected (0.00 sec)
- Rows matched: 1 Changed: 1 Warnings: 0
- MariaDB [mysql]> flush privileges;
- Query OK, 0 rows affected (0.00 sec)
- MariaDB [mysql]>
- ```
- ## end
- ```bash
- MariaDB [mysql]> quit
- Bye
- kelvin@gnux:~> mysql -u root -p (06/25 20:57:27)
- Enter password:
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 42
- Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
- Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement