Programming
DariaDB 기본명령어
느리게 걷는 즐거움
2021. 4. 11. 11:00
반응형
MySQL 클라이언트 접속
mysql.exe -u root -p
Version 정보 확인
MariaDB [(none)]> SELECT VERSION(); +----------------+ | VERSION() | +----------------+ | 10.5.9-MariaDB | +----------------+ 1 row in set (0.001 sec)
DATABASE 생성
// Parameter <데이터베이스 이름> : 생성하려는 데이터 베이스 이름 CREATE DATABASE <데이터베이스 이름>;
DATABASE 확인
MariaDB [(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.002 sec)
DATABASE 사용
// parameter <DATABASE 이름> : 사용하려는 DATABASE의 이름 // USE <DATABASE 이름> MariaDB [(none)]> USE information_schema Database changed
DATABASE에 생성된 TABLE 확인
MariaDB [information_schema]> SHOW TABLES; +---------------------------------------+ | Tables_in_information_schema | +---------------------------------------+ | ALL_PLUGINS | | APPLICABLE_ROLES | | CHARACTER_SETS | | CHECK_CONSTRAINTS |
DATABASE 삭제
// parameter : <DATABASE 이름> // DROP DATABASE <DATABASE 이름>
TABLE 생성
CREATE TABLE IF NOT EXISTS card_info ( cardno BIGINT(20), cardname VARCHAR(20), created DATE, PRIMARY KEY(cardno) );
반응형