- MySQL 설치
- sudo apt-get install mysql-server
- mysql이 정상적으로 설치된것을 확인한다.
- sudo systemctl enable mysql 명령을 사용하여, 서버 재시작시 mysql이 자동시작되도록 한다.
- mysql에 접속한다.
- sudo mysql -u root
- DB생성
- create database game_1;
- 유저생성
- CREATE USER 'user_1'@'%' identified by '암호';
- 유저권한설정
- grant all privileges on game_1.* to user_1@'%'
- 적용
- FLUSH PRIVILEGES;
- 해당 유저로 mysql접속을 확인한다.
- game_1 DB에 user,rank Table생성
CREATE TABLE IF NOT EXISTS game_1.kimchi_user (
id int unsigned not null AUTO_INCREMENT,
user_uuid varchar(64) not NULL,
created timestamp not null default CURRENT_TIMESTAMP,
updated timestamp null,
primary key(id),
unique key(user_uuid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS game_1.kimchi_rank (
user_id int unsigned not null,
stat_date date NOT NULL,
score int unsigned not null default 0,
created timestamp not null default CURRENT_TIMESTAMP,
updated timestamp null,
primary key(user_id,stat_date)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
'Unity' 카테고리의 다른 글
2025년3월4주 Flappy Bird (0) | 2024.12.24 |
---|---|
블랜더 (0) | 2024.12.24 |
2025년2월1주(2/3~2/9) 무료 서버 구축하기 (0) | 2024.12.24 |
2025년1월5주(1/27~2/2) (0) | 2024.12.24 |
2025년1월 2주 (0) | 2024.12.24 |