$ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
$ su
Password:
root@ip-***-**-*-***:/home/ubuntu# hostname
ip-***-**-*-***
root@ip-***-**-*-***:/home/ubuntu# hostnamectl set-hostname mystudy
root@ip-***-**-*-***:/home/ubuntu# hostname
mystudy
root@ip-***-**-*-***:/home/ubuntu# exit
exit
$ reboot # 터미널 프롬포트에서 호스트네임 변경 확인
$ sudo apt update
$ sudo apt install mariadb-server
$ sudo mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.3.34-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04
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)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.000 sec)
MariaDB [(none)]> set password for 'root'@'localhost' = password('새비밀번호');
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* to 'root'@'%' IDENTIFIED BY '비밀번호';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)
FLUSH PRIVILEGES;
명령어로 반영https://www.heidisql.com/download.php
$ sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Ctrl+X
- Y
- Enter
눌러 편집 종료 및 저장$ sudo systemctl stop mariadb
$ sudo systemctl start mariadb
or
$ sudo systemctl restart mariadb
좋은 글 감사합니다.