728x90

🐬 기본 환경

- IDE: MySQL Workbench

- DataBase: MariaDB

 

 

🖨️경고

1
2
3
4
5
6
7
8
9
Connection Warning(rds-mini1)
 
incompatible/nonstandardd server version or connection protocol detected(10.6.14)
 
A connection to this database can be established but some MySQL Workbench features may not work properly since the database is not fully compatble with the supported versions of MySQL.
 
MySQL Workbench is developed and tested for MySQL Server versions 5.65.7 and 8.0. 
For MySQL Server older than 5.6, please use MySQL Workbench version 6.3.
 
 

 

 

📡 원인

WorkBench는 MySQL과 함께 동작하도록 만들어졌으므로, MariaDB에는 적합하지 않을 수 있음

 

 

📰 해결 방법

* MariaDB GUI Tool인 HeidiSQL 사용

 

 

 

📚 참고 자료

 

MySQL Workbench incompatible/nonstandard server

I am new to using MySQL and I needed to download it for school, however, I keep getting this error message (picture below). I am using xampp and connecting using the username root. the port also ma...

stackoverflow.com

 

 

[AWS RDS] MySQL Workbench 연결오류/호환성 경고

Cannot Connect to DataBase Server / Connection Warning

velog.io

 

728x90
728x90

🐬 기본 환경

- IDE: MySQL Workbench

- DataBase: MySQL

 

 

발생 Error

MySQL로 다음 Source Code를 실행할 경우,

1
2
3
4
5
6
7
8
9
10
CREATE TRIGGER tempSeqTrigger BEFORE INSERT ON tempUser
FOR EACH ROW
BEGIN
  DECLARE sequence_value INT;
  
  INSERT INTO tempSeq VALUES (NULL);
  SET sequence_value = LAST_INSERT_ID();
  SET NEW.id = CONCAT(NEW.type, LPAD(sequence_value, 6'0'));
END;
 
 
 

⚠️ 다음과 같은 오류 발생

You have an error in your SQL syntax;

check the manual that corresponds to your MySQL server version for the right syntax to use

 

 

발생 원인

trigger안의 구분자(;)가 SQL상 기본 구분자(;)와 충돌

 

 

해결 방법

1
2
3
4
5
6
7
8
9
10
11
12
13
14
DELIMITER //
 
CREATE TRIGGER tempSeqTrigger BEFORE INSERT ON tempUser
FOR EACH ROW
BEGIN
  DECLARE sequence_value INT;
  
  INSERT INTO tempSeq VALUES (NULL);
  SET sequence_value = LAST_INSERT_ID();
  SET NEW.id = CONCAT(NEW.type, LPAD(sequence_value, 6'0'));
END//
 
DELIMITER ;
 
 
 

DELIMITER 문을 사용하여 기본 구분자인 ;와 충돌하지 않도록 임시 구분자를 설정

DELIMITER //

: //를 구분자로 사용하겠다는 의미

: END//로 블록을 종료하고 DELIMITER ;로 기본 구분자인 ;를 복원

 

728x90
728x90

🐬 기본 환경: IDE: MySQL Workbench, Language: MySQL

 

 

발생 Error

MySQL로 다음 Source Code를 실행할 경우,

1
2
insert into user_bookmark values ('user_test001');
 
 
 

🚨 다음과 같은 오류 발생

Error Code: 1136. Column count doesn't match value count at row 1

 

 

발생 원인

insert 구문 작성 시, table명만 작성하고 모든 column에 대하여 값을 입력하지 않음

 

 

해결 방법

1. insert 구문 작성 시, table명 뒤에 column을 따로 지정해주지 않을 경우, 모든 column에 값을 입력해야하며, 순서도 table의 column 순서와 맞춰야 함

▶ 모든 column값 입력

1
2
insert into user_bookmark(user_id, content_no) values ('user_test001''test001');
 
 
 

2. insert 구문 작성 시, table명 뒤에 입력하고자하는 column 지정

1
2
insert into user_bookmark(user_id) values ('user_test001');
 
 
 

 

728x90
728x90

🐬 기본 환경: IDE: MySQL Workbench, Language: MySQL

 

 

발생 Error

MySQL로 다음 Source Code를 실행할 경우,

1
2
update user set user_name='user_test002';
 
 
 

🚨 다음과 같은 오류 발생

Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

 

 

발생 원인

safe update mode가 적용된 상태에서 where 조건절 없이 update 구문 작성

 

 

해결 방법

1. update 구문 작성 시, where절이 없을 경우 모든 record가 업데이트됨

이를 방지하기 위해 safe update mode를 사용할 수 있으며, 해당 모드의 경우 update 구문에 where 조건절을 작성

1
2
update user set user_name='user_test002' where user_name='user_test001';
 
 
 

2. table에 safe update mode 해제

참고: 

 

[MySQL] Safe mode 해제 하는 방법

MySQL Safe mode Safe mode update 또는 delete 할 때 where 절이 없거나 where 절에 key column 외의 비교문일 때, 쉽게말해 한번에 여러 row 를 업데이트할 때, 막아두는게 Safe mode On 입니다. 예를들어 아래와 같은

hello-bryan.tistory.com

 

728x90
728x90

🐬 기본 환경: IDE: MySQL Workbench, Language: MySQL

 

 

발생 Error

MySQL로 다음 Source Code를 실행할 경우,

1
2
insert into user_bookmark(user_id, content_no) values ('user_test001', 'test001');
 
 
 

🚨 다음과 같은 오류 발생

Error Code: 1054. Unknown column 'content_no' on 'field list'

 

 

발생 원인

user_bookmark 테이블에 'content_no'이라는 column이 존재하지 않음

 

 

해결 방법

1. user_bookmark 테이블에 'content_no' 추가

1
2
3
4
5
6
7
8
9
# 맨 뒤에 column 추가
alter table 'user_bookmark' add 'content_no' varchar(30not null;
 
# 맨 앞에 column 추가
alter table 'user_bookmark' add 'content_no' varchar(30not null first;
 
# 지정 column 뒤에 column 추가
alter table 'user_bookmark' add 'content_no' varchar(30not null after '지정 column name';
 
 
 

2. 입력된 column명에 오타가 있는지 확인

 

 

 

참고 자료

 

MySQL 테이블 컬럼 추가 - 제타위키

다음 문자열 포함...

zetawiki.com

 

728x90