<aside> 📌 mysql root password : mung209pro@
</aside>
최신 버전 (2022.07.25 현재 8.0.29) 설치
sudo apt-get update
sudo apt-get install mysql-server
ubuntu@ip-172-26-8-54:~$ mysql --version
mysql Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))
ubuntu@ip-172-26-8-54:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 10
Server version: 8.0.29-0ubuntu0.20.04.3 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
mysql> create user 'd209'@'%' identified by 'mung209pro@';
Query OK, 0 rows affected (0.02 sec)
mysql> create database mungtopia;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mungtopia |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> grant all on mungtopia.* to 'd209'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql> show grants for 'd209'@'%';
+-----------------------------------------------------+
| Grants for d209@% |
+-----------------------------------------------------+
| GRANT USAGE ON *.* TO `d209`@`%` |
| GRANT ALL PRIVILEGES ON `mungtopia`.* TO `d209`@`%` |
+-----------------------------------------------------+
2 rows in set (0.00 sec)
<aside> 📢 172.26.8.54
</aside>
sudo service mysql restart
sudo ufw allow out 3306/tcp
sudo ufw allow in 3306/tcp
sudo service mysql restart
ubuntu@ip-172-26-8-54:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 33
Server version: 8.0.30-0ubuntu0.20.04.2 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
mysql> ALTER user 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mung209pro@';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
ubuntu@ip-172-26-8-54:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 35
Server version: 8.0.30-0ubuntu0.20.04.2 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
mysql> exit
Bye
ubuntu@ip-172-26-8-54:~$
ubuntu@ip-172-26-8-54:~$
<aside> 📌 https://danghyeona.notion.site/4b0614ffa23b4a7baba30e49f4079113#42acb380820649f28c791d5370e00155
</aside>