Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ sudo service mysql stop
- $ sudo mysqld_safe --skip-grant-tables &
- [1] 5395
- sangmin@ubuntu:~$ 170201 00:32:55 mysqld_safe Logging to syslog.
- 170201 00:32:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
- $ ps -e | grep mysql
- 5396 pts/6 00:00:00 mysqld_safe
- 5545 pts/6 00:00:00 mysqld
- $ mysql -uroot
- Welcome to the MariaDB monitor. Commands end with ; or g.
- Your MariaDB connection id is 2
- Server version: 10.0.29-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]> update user set password=PASSWORD("root") 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]> quit
- Bye
- $ sudo service mysql restart
- [1]+ Done sudo mysqld_safe --skip-grant-tables
- $ mysql -uroot -proot
- ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement