[MYSQL] OSX MySQL 언인스톨

http://ucnn.tistory.com/62 sudo rm -rf /usr/local/msql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/My* vim /etc/hostconfig and removed the line MYSQLCOM=-YES-

[MYSQL] OSX MYSQL 한글 설정

1. /etc/my.cnf 가 없어요! Open Terminal (in Utilities folder under Applications folder)  cd /usr/local/mysql/support-files/ sudo cp my-huge.cnf /etc/my.cnf and enter your admin password when prompted. You could do this from a non-admin account by using the su command, but that's probably a bit scary for some people ;)  You will now have a copy of my.cnf in /etc (just in case you don't know, that means the etc folder directly under the root folder, not under MySQL's install folder)  You can edit it with a text-editor such as TextWrangler by using File->Open Hidden, or if you are happy to use the command line, use:  cd /etc 출처: http://forums.mysql.com/read.php?11,366143,376017#msg-376017 2. 이제 설정을 덮어씌워요! [mysqld] character-set-server=utf8 collation-server=utf8_general_ci init_connect=SET collation_connection=utf8_general_ci init_connect=SET NAMES utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8

[MYSQL] 루트 비밀번호 변경

1. MYSQL 콘솔 접속 # mysql -uroot -p 2. 루트 비밀번호 변경 mysql> use mysql mysql> update user set Password = PASSWORD('비밀번호') where User = 'root' 3. 루트 비밀번호 변경후 적용 # mysqladmin -uroot -p reload

[MYSQL] 캐릭터셋 확인

# mysql -uroot -p mysql> use andong mysql> show variables like 'character%';

[MYSQL] ERROR 2002: Can't connect to local MySQL server through socket

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/m ysql.sock' (111) 라고 에러가 뜨면서 접속이 되지 않을 경우에... 다음과 같은 순서대로 하시면 가능합니다. #killall mysqld #chmod 755 -R /var/lib/mysql #chown mysql.mysql -R /var/lib/mysql #safe_mysqld --language=korean & 디렉토리 퍼미션 문제입니다.

[MYSQL] 특정 테이블 쿼리를 사용한 DB백업

# mysqldump -usuwon21 -p suwon21 terminal_info --where "no <= 213 and no >= 210 order by pnum asc, ip asc " > terminal_info.sql # mysqldump -u사용자 -p 데이터베이스명 테이블명 --where옵션 "쿼리문" > 백업할파일명.sql

[MYSQL] 데이터베이스 백업및 복원

0) 기존 디비 삭제 및 생성 mysql -uroot -p drop database DBNAME create database DBNAME 1) 디비 계정 생성 mysql> use mysql mysql> create database DBNAME mysql> grant all privileges on DBNAME.* to  ID@localhost  identified by 'PASSWORD'; //로컬 접속 할 경우 mysql> grant all privileges on DBNAME.* to  ID@'%'  identified by 'PASSWORD'; //원격 접속 할 경우 mysql> flush privileges; mysql> quit; # 데이터베이스 백업 mysqldump -uID -p --default-character-set=latin1 DBNAME > DBNAME.sql mysqldump -uID -p DBNAME > DBNAME.sql # 데이터베이스 복원 # mysql -uroot -p use DBNAME; source DBNAME.sql show tables;