목록MySQL (16)
미스터 역마살

에러 발생 이유 Mysql에서 This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable) 에러가 발생하는 이유는 아래와 같다. 구글링 해보니 MySQL 특정 버전대에서 Super 권한이 없는 user에게서 발생할 수 있는 문제이다. 원인은 mysql global variable 중 log_bin_trust_function_creators 옵션이었다. log_bin_trust_function_creators 옵션은 MyS..

에러가 나는 이유 THE TOTAL NUMBER OF LOCKS EXCEEDS THE LOCK TABLE SIZE 에러 발생할때 이유는 아래와 같다. MySQL은 저 문장이 들어오면 일단 select 결과를 모두 메모리로 가져온다. 그 메모리가 buffer 다. 이걸 조정하는 게 buffer_size 옵션이다. 그런데, 가지고 올 데이터량이 많아서 buffer_size를 넘어간다면? MySQL 은 Temp_Table이 완성되기 전에 You_Table 이 변경되면 안되니까, You_Table 에다가 lock을 걸어버린다. 즉, 그동안 다른 트랜잭션이 데이터를 변경할 수 없다는 소리다. 그래서 이런 에러가 생긴다. 해결방안 innodb_buffer_pool_size의 기본값이 8,388,608이라는데 이것은..

DB 생성시 설정 CREATE DATABASE testdb2 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; my,cnf 파일 수정 ## etc/my.cnf 파일로 가서 수정하기 & timezone도 변경 [client] default-character-set = utf8 [mysql] default-character-set=utf8 [mysqldump] default-character-set=utf8 [mysqld] character-set-server=utf8 collation-server=utf8_general_ci [mysqld] default-time-zone='+9:00' ## 재시작 systemctl restart mysqld

mysql에서 실행중인 쿼리를 확인 하는 방법은 SHOW PROCESSLIST를 통해 확인 할수 있다. -- 일반적인 PROCESS 확인 SHOW PROCESSLIST; -- 쿼리 전체 확인 PROCESS 확인 SHOW FULL PROCESSLIST; SELECT A.* FROM information_schema.PROCESSLIST A Id|User |Host |db |Command|Time|State |Info | --+------+--------------------+------------+-------+----+---------+-----------------------------------------------------------------------------------------------..

Server parameter란? mysql server 환경을 구성하기 위해서 적용되는 파라미터 값으로써 동적 변수, 정적 변수2가지가 있다. 동적 변수 : 변수값을 바꿨을때 서버를 restart하지 않아도 적용되는 변수 정적 변수 : 변수값을 바꿨을때 서버를 restart 해야만 적용되는 변수 시스템 변수 설정 위치 시스템변수는 my.cnf 라는 파일에 있다. mysql 서버를 설치할때 환경파일 위치를 기본 위치 (/etc/my.cnf)이외에 다른 디렉토리서 읽어 들이도록 설정했다면 패키지를 설치한 사람 이외에는 알기가 어렵다 이럴때 아래 명령어로 mysql, mariadb에서 불러들이는 my.cnf파일이 어떤것인지 확일 할 수 있다. [root@ip etc]# mysqld --verbose --he..

Mysql 접속 mysql -h[host주소] -u[user명] -p 2가지 방법 ## 리눅스 서비스로 등록되지 않은 경우 /etc/init.d/mysql start /etc/init.d/mysql stop ## 리눅스 서비스로 등록된 경우 service mysqld start service mysqld stop Mysql Start, restart, 상태 확인 작업 우분투 명령어 Centos 6 명령어 Centos 7 명령어 시작 service mysql start service mysqld start systemctl start mysqld 정지 service mysql stop service mysqld stop systemctl stop mysqld 재시작 service mysql restart ..