DB 생성
[root@byungun ~]# cat temp.sql
create database tempdb;
[root@byungun ~]# mysql -u root -p mysql < ./temp.sql
[root@byungun ~]# mysqlshow -u root -p
Enter password:
+--------------------+
| Databases |
+--------------------+
| information_schema |
| first |
| mysql |
| tempdb |
| test |
+--------------------+
[root@byungun ~]#
테이블 생성
[root@byungun ~]# cat temp_table.sql
create table temptable (
uid mediumint(3) NOT NULL,
name varchar(12) NOT NULL,
PRIMARY KEY (uid) );
[root@byungun ~]# mysql -u root -p tempdb < ./temp_table.sql
Enter password:
[root@byungun ~]#
[root@byungun ~]# mysqlshow -u root -p tempdb temptable
Enter password:
Database: tempdb Table: temptable
+-------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
| uid | mediumint(3) | | NO | PRI | | | select,insert,update,references | |
| name | varchar(12) | latin1_swedish_ci | NO | | | | select,insert,update,references | |
+-------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+
[root@byungun ~]#
'리눅스' 카테고리의 다른 글
[리눅스] CentOS 6.4 YUM으로 Apache + Tomcat6 연동하기 (0) | 2013.08.16 |
---|---|
[리눅스] rpm 명령어 (0) | 2013.08.14 |
[리눅스] gdb 사용법_core 덤프 (0) | 2013.08.14 |
NFS(Network File System)를 구축하는 방법 (0) | 2013.08.13 |
Rkhunter(Rootkit Hunter)을 소스 코드로부터 컴파일하여 설치하는 방법 (0) | 2013.08.05 |