메뉴 건너뛰기

Korea Oracle User Group

DBMS

MySQL 8.0 Reference Manual - Tutorial 1

 

3.1 Connecting to and Disconnecting from the Server

shell> mysql -h host -u user -p
Enter password: ********

 

위의 사용에서 -h 는 host를 가리키며 -u 는 유저, -p 는 패스워드를 가리킨다.

 

C:\Users\User>mysql -h localhost -u root -p
Enter password: *******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 8.0.17 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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>

 

서버가 시작되어 있지 않았을 때 접속을 시도하면 아래와 같은 에러를 만나게 된다.

 

C:\Users\User>mysql -h localhost -u root -p
Enter password: *******
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

C:\Users\User>

 

또는 아래와 같은 에러를 만나게 된다.(daemon으로 수행되는 방식인 unix 나 linux에서)

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

 

 

번호 제목 글쓴이 날짜 조회 수
19 Top-Rated PostgreSQL GUI Clients for Windows 명품관 2023.05.10 94
18 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database1 명품관 2020.02.28 190
» MySQL 8.0 Reference Manual - Tutorial - Connecting to and Disconnecting from the Server 명품관 2020.02.27 193
16 MySQL 8.0 Reference Manual - Tutorial - Entering Queries 명품관 2020.02.28 201
15 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database2 명품관 2020.02.29 235
14 How to Install MariaDB 10 on RHEL 8 [2] 명품관 2019.01.31 254
13 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database4 명품관 2020.03.03 254
12 PostgreSQL 16 설치하기(Installation) [1] 명품관 2024.01.24 415
11 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database3 명품관 2020.03.02 418
10 MySQL 8.0 Reference Manual - MySQL Server Administration2 - Server Configuration Validation 명품관 2020.04.17 419
9 MySQL Admin - 01 명품관 2019.10.08 704
8 DP, DPL, DPI에 관한trace log 내용 분석 명품관 2016.09.06 1038
7 MySQL 설치 후 외부 접속 허용하기 명품관 2016.09.09 2844
6 기동시 "Job for mysqld.service failed because the control process exited with error code." 에러로 기동 실패 명품관 2020.09.03 7921
5 MySQL 8.0 Reference Manual - MySQL Server Administration1 - Configuring the Server 명품관 2020.03.05 9598
4 티베로 에러 내용 확인 방법 명품관 2016.08.26 10742
3 티베로 trace log 중 ERROR_PSM_COMPILE_FAILED 에러란 명품관 2016.09.06 11434
2 Windows 버전 MySQL의 my.ini 파일 찾기 file 명품관 2020.03.01 13299
1 CentOS 6.7 에서 MySQL 5.7 설치 명품관 2016.09.09 13792
위로