본문 바로가기

Mysql

mysql 에러코드 Mysql - ErrCode Error code 1 : 명령이 허용되지 않음 Error code 2 : 그런 파일이나 디렉토리가 없음 Error code 3 : 그런 프로세스가 없음 Error code 4 : 중단된 시스템 호출 Error code 5 : 입력/출력 오류 Error code 6 : 장치가 설정되지 않았음 Error code 7 : 인수 명단이 너무 깁니다 Error code 8 : Exec 형식 오류 Error code 9 : 잘못된 파일 기술자 Error code 10 : 자식 프로세스가 없음 Error code 11 : 자원이 일시적으로 사용 불가능함 Error code 12 : 메모리를 할당할 수 없습니다 Error code 13 : 허가 거부됨 Error code 14 : 잘못된 .. 더보기
[MySql] binlog 파일 sql 파일로 변환 쉘스크립트 MySQL binary log 복구 binlog 복구 빈파일 복구 Mysql 복구 방법 중 binlog 파일을 이용한 복구 방법이 있다.하지만 bin 파일이 작게는 수십개 많게는 몇백개 일 경우 일일이 하나하나 복구하기에는 시간이 너무 소요 된다. 아래 스크립트는 find 명령어로 "*bin.000*" 파일을 긁어 온 다음에 while 문으로 기억 후bin.0001 파일이 똑같이 순차적으로 0001.sql 로 변환 되는 스크립트. #/bin/shsql=.sql find /usr/local/mysql/data/ -name "*bin.000*" |while read fa ; do asd=`echo $fa|awk -F "." '{print $2}'` /usr/local/mysql/bin/mysqlbinlog .. 더보기
MySQL 5.7.9 설치시 참고해야할 사항 현재 최신 버젼인 MySQL 5.7.9 설치시 참고해야할 사항 입니다. 1. MySQL 5.7 부터는 boost 1.5.9 이상이 필요하므로 cmake 옵션 뒤에 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost 라고 옵션을 추가하여야 합니다. (소스컴파일의 경우) 2. mysqli_connect(): Headers and client library minor version mismatch 라는 에러가 발생할 경우 터미널에서 php -i | grep 'Client API' 라고 명령을 내려서 Client API 버젼을 확인해보고 맞지 않을 경우 PHP를 다시 컴파일 해주시면 됩니다.(소스컴파일의 경우) 3. MySQL 5.7x중에서도 5.7.9부터는 mysql.use.. 더보기
mysql 패스워드 초기화 [root@localhost /usr/local/mysql/data]# /etc/init.d/mysqld stop Shutting down MySQL. [ OK ] 1.mysql 을 종료 한다. [root@localhost /usr/local/mysql/data]# /usr/local/mysql/bin/mysqld_safe --skip-grant & [2] 866 [1] Exit 127 /usr/bin/mysqld_safe --skip-grant [root@localhost /usr/local/mysql/data]# 160125 15:21:09 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 160125 15:21:10 .. 더보기
mysql 4.0 -> 5.5 DB 업그레이드 ### 원본 환경mysql 4.0 / euc_kr ### 대상환경mysql 5.5 / utf8 ### 원본서버에서 mysql 쿼리 및 data만 따로 추출 sqlyog 프로그램을 통해서 해당 데이터베이스를 백업 하는데 쿼리를 따로 추출하고 data 역시 따로 덤프를 뜬다 #### 대상서버에서 작업 2개의 파일 xinet_query.sql -> 쿼리만 추출xinet_data.sql --> data만 추출 변환작업 (query) sed -e 's/euc_kr/utf8/g' -i xinet_query.sql vi를 열어서 작업 :1,$s/TYPE=MyISAM/ENGINE=MyISAM/g 쿼리 import 작업 mysql -u root -p xinet < xinet_query.sql ---------------.. 더보기
mysql5.5 넘어오면서 제거된 내용들 1) language 시스템 변수 제거 (lc_messages_dir와 lc_messages를 사용) 2) log_bin_trust_routine_creators 시스템 변수 제거 (log_bin_trust_function_creators 사용) 3) myisam_max_extra_sort_file_size 시스템 변수 제거 3) record_buffer 시스템 변수 제거 (read_buffer_size 사용). 4) sql_log_update 시스템 변수 제거. 5) Innodb_buffer_pool_read_ahead_rnd와 Innodb_buffer_pool_read_ahead_seq 상태 변수 제거 (Innodb_buffer_pool_read_ahead와 Innodb_buffer_pool_read.. 더보기
mysql 기본 명령어 및 수정 Copyright (c) 2000, 2011, 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> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_sch.. 더보기
mysql 패스워드 복구방법 MySQL Password 복구방법 1. 기존의 동작 중이던 프로세스(데몬)을 종료 시킨다. 2. # mysqld_safe --skip-grant & 명령을 이용하여 안전모드로 동작시킨다. 3. # mysql 명령만으로 접속이 가능하다. 4. 실행 이후 과정 mysql> USE mysql; mysql> UPDATE user SET password=PASSWORD("패스워드") WHERE host="localhost"; mysql> flush privileges; mysql> exit login as: root root@192.168.2.154's password: Last login: Thu Dec 4 10:04:38 2014 from 192.168.2.104 [root@ns ~]# mysql ERROR.. 더보기
mysql configure: error: Cannot find libmysqlclient_r under /usr/local/mysql. Mysql 5.2 configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.Note that the MySQL client library is not bundled anymore! 위와 같은 에러가 나는 이유는 Apache 가 Thread 모드로 설치되어있으나, MySQL 은 Thread Safe 옵션을 주지 않았기 때문이다. 이 경우에는 MySQL 을 컴파일할 때 다음 옵션을 줌으로서 해결할 수 있다. --enable-thread-safe-client 더보기
mysql 외부접근 허용 mysql 외부접근 허용 mysql> INSERT INTO mysql.user (host,USER,password) VALUES ('192.168.0.0.','root',password('Password')); Query OK, 1 row affected, 3 warnings (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@192.168.0.0.; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) 더보기