Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB 구조 정리 #3

Open
uncoolclub opened this issue May 10, 2020 · 3 comments
Open

DB 구조 정리 #3

uncoolclub opened this issue May 10, 2020 · 3 comments

Comments

@uncoolclub
Copy link
Collaborator

데이터베이스 구조

table chat

create table chat (
	room_id int not null auto_increment primary key,
	person1 varchar(10) not null,
	person2 varchar(10) not null
);

table pit_user

create table pit_user (
  member_id varchar(20) not null primary key,
  pwd varchar(20) not null,
  name varchar(10) not null,
  birth varchar(40) not null,
  sex varchar(6) not null,
  animal varchar(30) not null,
  addr_city varchar(30) not null,
  addr_gu varchar(30) not null,
  profile boolean not null,
  img_url varchar(200) default null
);
@Daria0412
Copy link
Owner

create table message(
message_num int NOT NULL AUTO_INCREMENT PRIMARY KEY,
room_id int not null,
writer varchar(200) not null,
message varchar(10000) not null,
sent_at datetime default '0000-00-00 00:00:00');

@Daria0412
Copy link
Owner

실행 전, mysql 필수

mysql -uroot -pmirim2로 접속

create database pitapet
->database 생성

create user 'pitapet'@'%' identified by 'mirim2';
->새로운 사용자 만들기

grant all privileges on pitapet.* to 'pitapet'@'%';
->pitapet이라는 db를 pitapet유저에 모든 권한 주기

FLUSH PRIVILEGES;
->권한 적용

quit;
->root계정 사용중지

mysql -upitapet -pmirim2;
->pitapet 계정으로 접속

use pitapet;
->pitapet db 사용

@Daria0412
Copy link
Owner

create table pit_user (
member_id varchar(20) not null primary key,
pwd varchar(20) not null,
name varchar(10) not null,
birth varchar(40) not null,
sex varchar(6) not null,
animal varchar(30) not null,
addr_city varchar(30) not null,
addr_gu varchar(30) not null,
profile boolean not null,
img_url varchar(200) default null,
phone varchar(30)
)DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants