카테고리 없음

MAC OS Mysql 설치

MJHmong 2023. 3. 25. 20:47
# brew update
brew update

# 설치가능한 mysql 목록 확인
brew search mysql

# mysql 설치
brew install mysql

#We've installed your MySQL database without a root password. To secure it run:
#    mysql_secure_installation
#
#MySQL is configured to only allow connections from localhost by default
#
#To connect run:
#    mysql -u root
#
#To start mysql now and restart at login:
#  brew services start mysql
#==> Summary
#🍺  /opt/homebrew/Cellar/mysql/8.0.32: 317 files, 298.2MB
#==> Running `brew cleanup mysql`...
#Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
#Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
#==> Caveats
#==> mysql
#We've installed your MySQL database without a root password. To secure it run:
#    mysql_secure_installation
#
#MySQL is configured to only allow connections from localhost by default
#
#To connect run:
#    mysql -u root

To start mysql now and restart at login:
  brew services start mysql


# brew로 동작중인 서비스 확인
brew services list

# mysql start
brew services start mysql

# mysql stop
brew services stop mysql

# 접속
mysql -uroot -p --host=127.0.0.1 --port=3306

# DB 확인
mysql>SHOW DATABASES;

# mysql 정보 확인 ( 설정파일 위치 등)
mysql --help

# mysql 시스템 변수 확인
SHOW GLOBAL VARIABLES;

# Like를 이용하여 특정 global 변수 설정값 확인
mysql> SHOW GLOBAL VARIABLES LIKE "%connection%";
+-----------------------------------+----------------------+
| Variable_name                     | Value                |
+-----------------------------------+----------------------+
| character_set_connection          | utf8mb4              |
| collation_connection              | utf8mb4_0900_ai_ci   |
| connection_memory_chunk_size      | 8912                 |
| connection_memory_limit           | 18446744073709551615 |
| global_connection_memory_limit    | 18446744073709551615 |
| global_connection_memory_tracking | OFF                  |
| max_connections                   | 151                  |
| max_user_connections              | 0                    |
| mysqlx_max_connections            | 100                  |
+-----------------------------------+----------------------+
9 rows in set (0.00 sec)