이어서 ~
- MySQL monitor (Client)
mysql -hlocalhost -uroot -p
실행 h서버주소 u관리자아이디 p비밀번호입력받아라
하나의 서버에 여러개의 데이터베이스가 존재할 수 있다. (보통 앱 하나당 데이터베이스 하나)
- CUI 로 제어
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
▶ C:\Users\USER>cd C:\Bitnami\wampstack-5.6.30-5\mysql\bin
▶ C:\Bitnami\wampstack-5.6.30-5\mysql\bin>mysql -hlocalhost -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.36 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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.06 sec)
▶ mysql> CREATE DATABASE opentutorials CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| opentutorials |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
▶ mysql> use opentutorials;
Database changed
mysql> CREATE TABLE `topic` (
-> `id` int(11) NOT NULL AUTO_INCREMENT,
-> `title` varchar(100) NOT NULL,
-> `description` text NOT NULL,
-> `author` varchar(30) NOT NULL,
-> `created` datetime NOT NULL,
-> PRIMARY KEY (id)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.11 sec)
mysql> show tables;
+-------------------------+
| Tables_in_opentutorials |
+-------------------------+
| topic |
+-------------------------+
1 row in set (0.00 sec)
아아아. 생활코딩은 php로 연동하는구나 !!!! 난 jsp Java로 해야하니 여기서부턴 혼자해보자 ~~
- MySQL Client Tool로 workbench를 사용해봐야 겠다. MySql Monitor으로 user, database, table세팅. workbench 접속.
- Spring MySQL 연동 ( http://blog.naver.com/wlsgud2229/221008864277 참고)
maven으로 mysql-connector-java-6.5.0.jar 생성했는데 driver오류 발생한다.
내일 xml, 에서 바로연결하는 걸로 해보거나 maven 다시 확인해보자