본문 바로가기
개발/mysql

[MAC] mysql database생성하기

by yo.na 2022. 1. 17.
1. mysql 시작
$ brew services start mysql 
// mysql 시작

$ mysql -uroot 
// mysql 모니터로 들어가기
2. mysql 에 기본적으로 생성되는 데이터베이스는 다음과 같다.
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
3. 새로운 데이터베이스를 추가하기 위해서 다음의 명령어 사용
mysql> create database 원하는이름;
Query OK, 1 row affected // 이 메세지가 뜨면 잘 생성 된 것
4. 잘 생성되었나 확인
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| toebox             |
+--------------------+
// 밑에 새로운 데이터베이스가 추가된 것 확인