반응형

설치 후 root 패스워드 변경 방법

 

터미널 #1 (safe 모드로 기동)

터미널 #2 (패스워드 변경)

[root@Mariacluster1 mysql]# mysqld_safe --skip-grant-tables &

[1] 13103

[root@Mariacluster1 mysql]# 160728 13:57:55 mysqld_safe Logging to '/var/lib/mysql/Mariacluster1.err'.

160728 13:57:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

 

 

[root@Mariacluster1 ~]# mysql -u root

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 2

Server version: 10.1.16-MariaDB MariaDB Server

 

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("root1122") where User='root';

Query OK, 4 rows affected (0.00 sec)

Rows matched: 4  Changed: 4  Warnings: 0

 

MariaDB [mysql]> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

MariaDB [mysql]> exit

Bye

 

[root@Mariacluster1 mysql]# service mysql restart

Shutting down MySQL..160728 14:02:45 mysqld_safe mysqld from pid file /var/lib/mysql/Mariacluster1.pid ended

 SUCCESS!

Starting MySQL. SUCCESS!

[1]+  Done                    mysqld_safe --skip-grant-tables

 

 

[root@Mariacluster1 ~]# mysql -uroot -proot1122 mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 5

Server version: 10.1.16-MariaDB MariaDB Server

 

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 [mysql]>


반응형

+ Recent posts