Skip to main content

mariadb 설정

 

vim /etc/mysql/mariadb.conf.d/50-server.cnf

에서
bind-address            = 127.0.0.1 
bind-address            = 0.0.0.0 
로 변경해야 외부에서 접속 가능한다.


time-zone 변경
default-time-zone='+9:00'


수정한 다음,
#>sudo systemctl enable mariadb.service
#>sudo systemctl start mariadb.service
해서 반영된 점을 확인한다.

#> cat /etc/mysql/mariadb.conf.d/50-server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Basic Settings
#

user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
basedir                 = /usr
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
lc-messages-dir         = /usr/share/mysql
lc-messages             = en_US
skip-external-locking

# Broken reverse DNS slows down connections considerably and name resolve is
# safe to skip if there are no "host by domain name" access grants
#skip-name-resolve

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address            = 127.0.0.1
bind-address            = 0.0.0.0
default-time-zone='+9:00'


#
# * Fine Tuning
#

key_buffer_size        = 128M
#max_allowed_packet     = 1G
#thread_stack           = 192K
#thread_cache_size      = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#myisam_recover_options = BACKUP
#max_connections        = 100
#table_cache            = 64



#
#       Query Cache Configuration
#
query_cache_size        = 16M

#
# * Logging and Replication
#

# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# Recommend only changing this at runtime for short testing periods if needed!
#general_log_file       = /var/log/mysql/mysql.log
#general_log            = 1

# When running under systemd, error logging goes via stdout/stderr to journald
# and when running legacy init error logging goes to syslog due to
# /etc/mysql/conf.d/mariadb.conf.d/50-mysqld_safe.cnf
# Enable this if you want to have error logging into a separate file
log_error = /var/log/mysql/error.log
# Enable the slow query log to see queries with especially long duration
#slow_query_log_file    = /var/log/mysql/mariadb-slow.log
#long_query_time        = 10
#log_slow_verbosity     = query_plan,explain
#log-queries-not-using-indexes
#min_examined_row_limit = 1000

# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
#max_binlog_size        = 100M

#
# * SSL/TLS
#

# For documentation, please read
# https://mariadb.com/kb/en/securing-connections-for-client-and-server/
#ssl-ca = /etc/mysql/cacert.pem
#ssl-cert = /etc/mysql/server-cert.pem
#ssl-key = /etc/mysql/server-key.pem
#require-secure-transport = on

#
# * Character sets
#

# MySQL/MariaDB default is Latin1, but in Debian we rather default to the full
# utf8 4-byte character set. See also client.cnf
character-set-server  = utf8mb4
collation-server      = utf8mb4_general_ci

#
# * InnoDB
#

# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# Most important is to give InnoDB 80 % of the system RAM for buffer use:
# https://mariadb.com/kb/en/innodb-system-variables/#innodb_buffer_pool_size
#innodb_buffer_pool_size = 8G

# this is only for embedded server
[embedded]

# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

# This group is only read by MariaDB-10.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.5]

Comments

Popular posts from this blog

사자성어(가)

奇想天外(기상천외) 보통 사람이 쉽게 짐작할 수 없을 정도로 엉뚱하고 기발한 생각 技成眼昏(기성안혼) 재주를 다 배우니 눈이 어두워짐. 늙어서 재주가 쓸모 없게 됨 起承轉結(기승전결) 한시의 詩 作에서, 절구체의 전형적인 구성법을 지칭 제1구를 기구, 제2구를 승구, 제3구를 절구, 제4구를 결구 문장 구성에 있어서의 4단계, 서론, 설명, 증명, 결론 寄與補裨(기여보비) 이바지하여 돕고 부족함을 보태어 줌. 杞人之優(기인지우) 杞나라 사람의 군걱정이란 뜻. 곧 쓸데없는 걱정이나 무익한 근심을 말함.(=杞憂) 旣張之舞(기장지무) 이미 벌린 춤. 이미 시작한 일을 중간에서 그만 둘 수 없다 騎虎難下(기호난하) 이미 시작된 일을 중도에서 그만 둘 수 없음을 비유한 말 騎虎之勢(기호지세) = 기호난하 奇貨可居(기화가거) 진기한 물건을 사 두었다가 때를 기다리면 큰 이익을 볼 수 있다 吉祥善事(길상선사) 매우 기쁘고 좋은 일 吉凶禍福(길흉화복) 길한 일, 흉한 일, 언짢은 일, 복된 일 寄與補裨(기여보비) 이바지하여 돕고 부족함을 보태어 줌. 杞人之優(기인지우) 杞나라 사람의 군걱정이란 뜻. 곧 쓸데없는 걱정이나 무익한 근심을 말함.(=杞憂)  B A B A B A B A B A B A B A

nginx로 다중 포트 설정 및 다중 react app 설정

nginx에 다중 포트 설정하기 react로 여러 webapp를 개발하고, 동일한 서버에 실행시킬 필요가 있다. 이때 간단히 nginx에서 다중포트로 여러 webapp를 동일한 서버에서 실행시킬 수 있다. /etc/nginx/sites-available/에 default 파일이 있다. 보통 port 80로 설정되어 있다. 이 파일을 복사해서 sub로 명명한다.   아래와 같이 포트 8080으로 정하고, react app를 build한 디렉터리를 root <dir>로 지정하고, $> sudo service nginx restart 하면 된다. $>sudo systemctl status nginx.service 로 nginx 상태 확인이 가능하면, $> netstat -ano | grep 8080 으로 8080 포트가 살아있는 또는 외부PC에서  $>telnet ip 8080으로 telnet 접속이 되는지 확인하면 된다. 종종 Nginx 500 Interval Server Error가 발생하는데, 이는 1) root <dir>에서 <dir> 주소가 정확하지 않거나, 2) 파일 권한이 없거나이다. chmod 755 <dir>하면 대부분 해결될 것이다. 그럼 오늘도 유익한 하루 되시길..   

gnome screen

screen nano editor에서 빠져나오기 C+x가 screen prefix 일 경우, nano 에디터에서 빠쪄나오기 어렵다. 이때는 C+t, C+z하면 background 처리한 후, kill 명령어로 nano 실행 프로세스를 죽여야 한다.     그리고 crontab -e를 실행할 때, export VISUAL=vim; crontab -e로 실행해라.     screen session title를 변경 원할 경우 C+x, shift+a 하면 각 창 제목을 변경할 수 있다.     user's manual http://www.delorie.com/gnu/docs/screen/screen_toc.html - Run a new screen session # screen - Reattach to a previously detatched session # screen -R - Create a new window. # '''prefix''' c - Kill the current window - after confirmation # '''prefix''' k - 현재 창의 창 번호를 변경하는 방법 예 창번호 3에서 1로 변경할 경우, 먼저 창 3으로 이동한 상태에서 # '''prefix''' :number 1 [enter]하면 창번호3이 1로 변경됨.  - Switch to the other window # '''prefix''' space - Detach & Attach screen を起動した状態で、 # Ctrl-z d or Ctrl-z ^D とすると、screenを起動する前のシェルに戻ります。screenはバックグランドで動いています。これを「Detachedデタッチ」と言います。 Attachedとは「再開」 デタッチしたセッションを確認...