๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’š ๊ฐœ๋ฐœ/๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค

[MySQL] MariaDB root ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ (MariaDB 10.4 ์ด์ƒ)

by devshin.kr 2021. 7. 14.
728x90
๋ฐ˜์‘ํ˜•

๊ณต๋ถ€ํ•˜๋ ค๊ณ  ์„ค์น˜ํ•œ MairaDB root์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด... root ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ฐ”๊พธ๊ณ ์ž ๊ตฌ๊ธ€๋ง ํ–ˆ๋‹ค.

๋‚˜๋Š” MariaDB 10.6.3 ์„ ์‚ฌ์šฉํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” qwer๋กœ ๋ณ€๊ฒฝํ•˜๊ธฐ๋กœ ํ–ˆ๋‹ค.

 

1. ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ mysql ๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค.

MariaDB [(none)]> use mysql

 

2. ์‹คํŒจํ•œ ๋ช…๋ น๋ฌธ

-- ์‹คํŒจํ•œ ๋ช…๋ น๋ฌธ. MariaDB 10.4 ์ด์ „ ๋ฒ„์ „์—์„œ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋‹ค
MariaDB [myssql]> update user set password=password('qwer') where root='root';

- ๋‹ค์‹œ ๊ตฌ๊ธ€๋ง์„ ํ•˜๋‹ˆ, MariaDB 10.4๋ถ€ํ„ฐ๋Š” root ์˜ ํŒจ์Šค์›Œ๋“œ๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ๋ฐ”๋€Œ์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค.

 

3. ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ์— ์„ฑ๊ณตํ•œ ๋ช…๋ น๋ฌธ

-- MariaDB 10.4 ๋ถ€ํ„ฐ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ช…๋ น๋ฌธ
MariaDB [mysql]> set password=password('qwer');

- ์ฐธ๊ณ ๋กœ, password() ํ•จ์ˆ˜๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์•”ํ˜ธํ™”ํ•˜๋Š” ๋ฐ์— ์‚ฌ์šฉ ๋œ๋‹ค๊ณ  ํ•œ๋‹ค.

 

4. ๋ฐ”๋€ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ํ™•์ธํ•˜๋Š” ๊ณผ์ •์€ exit; ์œผ๋กœ ๋‚˜๊ฐ„ ํ›„์— ๋‹ค์‹œ ์ ‘์†์„ ์‹œ๋„ํ•œ๋‹ค.

 

Enter password: *********
Welcome to the MariaDB monitor.  Commands end with ; or \g. 
Your MariaDB connection id is 6
Server version: 10.6.3-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql
Database changed
MariaDB [mysql]> update user set password=password('qwer') where user='root';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
MariaDB [mysql]> set password=password('qwer');
Query OK, 0 rows affected (0.011 sec)

MariaDB [mysql]> exit;
Bye

C:\Program Files\MariaDB 10.6\bin>mysql -u root -p
Enter password: *****
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.6.3-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€