본문 바로가기

DB 수업 정리

mysql 설치 & 설정

root 비번 설정 후 까먹으면안됨.

 

user 만들고 , 권한부여

 

환경변수 설정

 

path  >  새로만들기 > 찾아보기 > my sql > server > bin 

 

 

환경변수 잘 됐는지 확인 

mysql --version

 

유저네임, 비밀번호 입력해서 연결

 

show databases : 데이터 베이스 목록보기

use dbname; : 데이터 목록중 사용할 db 선택

show tables; : 선택한 db의 테이블 목록보기

C:\Users\EZENIC-127>mysql -umysqlUser -pmysql
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 8.0.39 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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 |
| performance_schema |
| testdb             |
+--------------------+
3 rows in set (0.00 sec)

mysql> use testdb;
Database changed
mysql> show tables;
Empty set (0.00 sec)

 

'DB 수업 정리' 카테고리의 다른 글

DB 5일차.  (3) 2024.09.02
DB 4일차  (0) 2024.08.30
DB 3일차  (2) 2024.08.29
DB 2일차  (0) 2024.08.28
DB 1일차  (5) 2024.08.27