sudo apt install mysql-server
sudo ufw allow mysql
sudo systemctl enable mysql
sudo systemctl start mysql
sudo mysql -u root
CREATE DATABASE DB명 default CHARACTER SET UTF8;
CREATE USER '유저명'@'localhost' IDENTIFIED BY '패스워드';
GRANT ALL PRIVILEGES ON *.* TO '유저명’@‘%’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
[HY000][1418] This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
SET GLOBAL log_bin_trust_function_creators=ON;
mysql> SHOW VARIABLES LIKE 'sql_mode';
+---------------+-----------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------+-----------------------------------------------------------------------------------------------------------------------+
| sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+---------------+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql>
mysql> SET SQL_MODE='ALLOW_INVALID_DATES';
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'sql_mode';
+---------------+---------------------+
| Variable_name | Value |
+---------------+---------------------+
| sql_mode | ALLOW_INVALID_DATES |
+---------------+---------------------+
1 row in set (0.00 sec)
mysql>
vi /etc/mysql/mysql.conf.d/mysqld.cnf
[mysql]
sql_mode = "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
mysql> SHOW GLOBAL VARIABLES LIKE '%sql_mode%';
+---------------+-----------------------------------------------------------------------+
| Variable_name | Value |
+---------------+-----------------------------------------------------------------------+
| sql_mode | STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+---------------+-----------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
에러 : The server requested authentication method unknown to the client [caching_sha2_password]
해결 : alter user '아이디'@'127.0.0.1' identified with mysql_native_password by '패스워드';
'CSP > akamai-linodes' 카테고리의 다른 글
cent 설치 후 https, mysql 설치 (0) | 2024.08.11 |
---|---|
linodes 에서 리눅스 생성 및 ssh 접속. (0) | 2024.08.09 |