처음 맥에 MySQL을 설치해서 돌려봅니다. 2006년부터 맥을 써왔지만, 이번에 처음입니다.
http://www.mysql.com 에서 mysql-5.5.8-osx10.6-x86_64.dmg 파일을 다운로드 받아서 3가지를 설치했습니다.

./mysql-5.5.8-osx10.6-x86_64.pkg
./MySQLStartupItem.pkg
./MySQL.prefPane

MySQL.prefPane 이후에 이렇게 시스템 환경설정에 만들어집니다.

메뉴에 들어가면 Start/Stop 그리고 현재 DB 사용여부 표시 기능 밖에는 없습니다.

DB를 실행한 뒤에 다음과 같이 토비의 스프링3를 위해서 DB와 table을 만들었습니다.

kenuheoyimacbookpro-4:docs kenu$ mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6081
Server version: 5.5.8 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, 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 |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> grant all privileges on *.* to spring@localhost
    -> identified by 'book' with grant option;
Query OK, 0 rows affected (0.04 sec)

mysql> create database springbook;
Query OK, 1 row affected (0.02 sec)

mysql> use springbook;
Database changed

mysql> create table users (
    -> id varchar(10) primary key,
    -> name varchar(20) not null,
    -> password varchar(10) not null
    -> );
Query OK, 0 rows affected (0.46 sec)

mysql> 

spring 아이디에 book 비번으로 접속 가능하게 하고 springbook 이라는 database를 만들고, 그 안에 users라는 table을 만든 것입니다. 

계속 진도 나가야겠습니다. 갈 길이 멉니다.

+ Recent posts