카테고리 없음
MySQL Install on Mac OS X
Linzyseo
2019. 7. 13. 16:47
1. MySQL 다운로드
> https://www.mysql.com/downloads/ 접속
> MySQL Community Edition 다운로드
> MySQL Community Server 클릭
2. MySQL Client tool인 Workbench 도 추가로 설치하자,
> https://dev.mysql.com/downloads/workbench/
MySQL :: Download MySQL Workbench
Download MySQL Workbench Please report any bugs or inconsistencies you observe to our Bugs Database. Thank you for your support!
dev.mysql.com
3. 환경 변수 설정
$ echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
4. 접속 확인
mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.16 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
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>
5. Database 생성
mysql> create database testdb;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| testdb |
+--------------------+
6. User 생성 및 testdb 권한 부여
mysql> create user testuser@localhost identified by 'password';
mysql> grant all privileges on testdb.* to testuser@localhost;
$ mysql -u testuser -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 8.0.16 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| testdb |
+--------------------+
2 rows in set (0.01 sec)