2012-10-06

DBMS/MySQL]var_디렉토리_용량_부족시에_데이터_디렉토리_이전


1. mysql을 잠시 내리고 db 파일(/var/db/mysql 디렉토리)을 여유공간으로 이동을 하고 예전 경로에 심볼릭

링크를 걸어준다. 



예시 ) 

새로운 하드 마운팅 네임 : /usr/local/db



기존 mysql 설치 디렉토리 : 프비에서 포트로 설치시 디폴트. 아님 /usr/local/mysql



mysql 데이터 디렉토리 : /var/db/mysql 



# /usr/local/etc/rc.d/mysql-server.sh stop   <-- mysql 데몬 shutdown



# mv /var/db/mysql /usr/local/db/               <-- /var/db/mysql 디렉토리를 /usr/local/db/

밑으로 이동



# chown -R mysql:mysql /usr/local/db           <-- 소유권을 mysql:mysql로 수정

  (리눅스에서는 chown -R mysql.mysql /usr/local/db 이렇게(???) 할 것임)



# ln -s /usr/local/db/mysql /var/db/mysql       <-- 심볼릭 링크 검



# /usr/local/etc/rc.d/mysql-server.sh start     <-- 재기동

DBMS/MySQL]utf8_환경으로_자료_conversion_성공기(database.sarang.net)




utf8 환경으로 자료 conversion 성공기

http://database.sarang.net/?inc=read&aid=24971&criteria=mysql&subcrit=&id=&limit=20&keyword=unicode&page=1

DBMS/MySQL]mysqladmin_사용법



mysqladminClient for Administering a MySQL Server

1) 데이터베이스의 creating 
2) 데이터베이스의 dropping 
3) grant tables의 reload 
4) flushing tables to disk 
5) reopening log file 
6) 서버의 version, process, status에 관한 정보 

【사용법】 % mysqladmin [options] command [command-option] command ... create db_name 새 데이터베이스를 만듦, 


쉘 프롬프트
mysqladmin create db_name
mysql>프롬프트mysql> create database db_name;

 drop db_name 기존의 데이터베이스와 그 내부의 모든 테이블을 삭제 


쉘 프롬프트
mysqladmin drop db_name
mysql>프롬프트mysql> drop database db_name;
 extended-status 서버로부터 확장된 상태 메시지를 받음 


쉘 프롬프트
mysqladmin extended-status
mysql>프롬프트mysql> show status;
 flush-hosts 호스트의 캐시를 flush함(refresh의 일부임) 


쉘 프롬프트
mysqladmin flush-hosts
mysql>프롬프트mysql> flush hosts;
 flush-logs 모든 logs를 flush함(refresh의 일부임) 


쉘 프롬프트
mysqladmin flush-logs
mysql>프롬프트mysql> flush logs;
 flush-tables 모든 테이블을 flush함(refresh의 일부임) 


쉘 프롬프트
mysqladmin flush-tables
mysql>프롬프트mysql> flush tables;
 flush-privileges grant 테이블을 reload함(reload와 같음) 


쉘 프롬프트
mysqladmin flush-privileges
mysqladmin reload
mysql>프롬프트mysql> flush privileges;
 flush-status 상태변수를 초기화함(refresh의 일부임) 


쉘 프롬프트
mysqladmin flush-status
mysql>프롬프트mysql> flush status;
 kill id,id,... Mysql 스레드를 kill함 


쉘 프롬프트
mysqladmin kill id
mysql>프롬프트mysql> kill '스레드번호';
 password 비밀번호를 새로 설정함 


쉘 프롬프트
mysqladmin 사용자 password new_password
mysql>프롬프트mysql> set password=password(new_password);
 ping mysqld가 동작중인지 체크함 processlist 서버에 작동중인 스레드 목록을 보여줌 

쉘 프롬프트mysqladmin processlist
mysql>프롬프트mysql> show processlist;
 reload Grant 테이블을 다시 reload함 

쉘 프롬프트mysqladmin reload
mysqladmin flush-privileges
mysql>프롬프트mysql> flush privileges;
 refresh 작업중인 모든 테이블을 flush하고 닫은 후 다시 log files를 연다 shutdown 서버를 다운시킴 

쉘 프롬프트mysqladmin shutdown
mysql.sever stop
 slave-start slave replication 스레드를 시작함 slave-stop slave replication 스레드를 정지함 status 서버의 간단한 상태 메시지를 봄 variables 사용가능한 변수를 보여줌 



쉘 프롬프트
mysqladmin variables
mysql>프롬프트mysql> show variables;
 version 서버의 버전을 알아봄 



쉘 프롬프트
mysqladmin version
mysqladmin --version
mysql>프롬프트mysql> select version();

 【예제】 ☜ 인식가능한 단축어를 사용해도 됨 % mysqladmin proc stat +------+-------+-----------+----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +------+-------+-----------+----+---------+------+-------+------------------+ | 1573 | jijoe | localhost | | Query | 0 | | show processlist | +------+-------+-----------+----+---------+------+-------+------------------+ Uptime: 585293 Threads: 1 Questions: 178697 Slow queries: 0 Opens: 541 Flush tables: 1 Open tables: 57 Queries per second avg: 0.305 % % mysqladmin --help grant tables에 주어지는 권한에 따른 mysqladmin에서 수행 할 수 있는 허용되는 명령어 
privilegeCommands permitted to privilege holders
RELOADreload, refresh, flush-privileges, flush-hosts, flush-logs, flush-tables
SHUTDOWNshutdown
PROCESSprocesslist
SUPERkill

DBMS/MySQL]mysql 사용자 추가 및 디비 생성



mysql > create database sms;

mysql > grant all on sms.* to smsuser@localhost identified by 'smspw' with grant option;

mysql > grant all on sms.* to smsuser identified by 'smspw' with grant option;

mysql > flush privileges;


===>사용자 추가 방법
mysql> grant all on aaa.* to abcd@localhost identified by 'abcd' with grant option;
                    ^^^^^    ^^^^^^^^^^^^^^               ^^^^^^
                     디비     계정                          비번
mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)

====> 비밀번호 변경
# mysqladmin abcd 'abcd' 'abcde'


DBMS/MySQL]mysql_upgrade_설명_문서(4.0 ->4.1)



이 글은 database.sarang.net 에 있는 MySQL 섹션에 있는 글 입니다.

1. 준비작업
http://database.sarang.net/?inc=read&aid=24240&criteria=mysql&subcrit=&id=&limit=20&keyword=unicode&page=1

2. db 이전
http://database.sarang.net/?inc=read&aid=24241&criteria=mysql&subcrit=&id=&limit=20&keyword=unicode&page=1

3. 4.1  버전으로 이전.
http://database.sarang.net/?inc=read&aid=24242&criteria=mysql&subcrit=&id=&limit=20&keyword=unicode&page=1

DBMS/MySQL]mysql_gui_툴._sqlyog_사용법



최근에 우리는 XAMPP에 대해 당신이 당신의 databases. 을 관리하는 것을 이용할 수 있는 디폴트 데이터베이스 고객이 phpMyAdmin below: 의 screenshot을 보아서 당신이 아파치를 시작하는 방해와 PHP와 어느 mySQL.  XAMPP이 phpMyAdmin와 더불어 싸서 온다을 썼다.
이미지
더 많은 스텝에게 오퍼레이션에게 . 을 내리라고 요구한다 그리고 즉 기능적인 마우스 오르쪽 버튼 클릭 지름길이지 않은 phpMyAdmin이 많은 특징을 가지지만 그것이 웹에 기초를 둔 고객이기 때문에 당신이 그것의 인터페이스의 능력으로 제한된다.
SQLyog 일은 오라클 database. 을 위해 그것이 당신을 mySQL 데이터베이스 어떤 서버도 연결하게 하고 전통적인 그래픽 사용자 인터페이스를 잘 알고 있는 사용자가 쌓은 그래픽 사용자 인터페이스의 왼쪽 부분(위)에 데이터베이스 고객이 그럴 것이다 확실하게 디스플레이 데이터베이스가 objects 당신이 www.webyog.com으로부터 자유로운 버전을 얻을 수 있다 L SQL 개발자 appreciate.  나이 많은 MS SQL 기업 매니저와 P을 좋아한다.
이미지
보아라 클릭이 되 만들어 낸다 뛰어나고 미리이어라 정하고 있다 만들어 내 지고 나타나라 저축해라 편집해라 있다 두고 남겨지고 갈라져라 위에 언제 비슷하게 더 lower 또한 자동적으로 더 쉽게 hey as 그리고 또한 직관적으로 당신 예 그것 나 테이블 그것 뷰 권리(정의)사이드 window.  컬럼 가치관 변경 dropdown field.  위치 버튼 위 테이블 할 수 있다.
이미지
물건 탭을 찰깍 소리가 나는 것은 테이블 SQL을 만들고 똑바로이어라 팔 원하는 사람들을 위해 매우 편리하게 이것이 들어오는 컬럼 information.  뿐만 아니라 테이블을 만들어 내는 데 이용된 질문을 보여 줄 것이다:
이미지
테이블을 마우스 오른쪽 버튼으로 클릭하는 것은 Novice process.  SQL을 따르기 위해 쉽게 개발자가 확실하게 이들 지름길을 사랑할 것이다 이것이 일이 컬럼과 인덱스를 바꾸는 것을 좋아하게 하는 table. 을 위한 문맥 민감한 많은 오퍼레이션을 보여 줄 것이다.
이미지
그래픽 사용자 인터페이스에 기초를 둔 고객과 함께 SQLyog을 좋아해라,사용자는 테이블에(게)간단한 인덱스 command.  A 마우스 오르쪽 버튼 클릭을 만들면 찰깍 소리가 나는 것이 인덱스 의지 방해를 관리해라 드물게 사용된 queries.  창조적인 일을 하는 약간의 인덱스가 예를 들면 당신을 필요로 하지 않을 것이라는 것을 기억해서 당신이 즉시 인덱스를 만든다 이슈에(게)걱정해야 할 것이지 말아라:
이미지
질문 에디터 field. 에 의하여 창에서 위의 왼쪽 부분에(서)녹색 버튼이 런 역할을 하고 모든 버튼을 수행한다 당신의 자신의 SQL 명령을 수행하는 것을 지지한다.
이미지
기초적인 로그인 information. 을 꽉 채우는 as 쉽게 당신이 패스워드와 함께 커넥션을 구할 수 있다 그래서 당신이 next. 에 대한 1 커넥션으로부터 쉽게 바꿀 수 있다을 때와 경영하는 데이터베이스 커넥션은 또한 그대로이다.
이미지
가져라 있다 세워 지고 있다 할 수 있다 편집해라 할 수 있다 떨어져라 로그인해라 한다 부담을 주어라 취한다 평균 되고 같이이어라 안에 같이(위)에 같이 같이 강력하게 그렇지 않으면 또한 건방지게 또한 as 유일하게 about 나의 당신 mySQL 매니저 응용 SQLyog very much recommended.  1 일(물건)그것 이것 도구 그것 당신 얼룩 텍스트 그래픽 mode.  당신 과정 다른 사람(것)사용자 그것 당신 이것 privilege.  그것 원인 랩탑 그것 18MB 램 자원 질문 약간 100 완전히 바로 필요로 하지 않는다.

DBMS/MySQL]mysql_5.0.41_소스_컴파일_해서_설치하기



The basic commands that you must execute to install a MySQL source
distribution are:
     shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
     shell> cd mysql-VERSION
     To change both the character set and the collation, use both the
     `--with-charset' and `--with-collation' options. The collation
     must be a legal collation for the character set. (Use the `SHOW
     COLLATION' statement to determine which collations are available
     for each character set.)
     shell> ./configure --prefix=/usr/local/mysql --with-charset=utf8
     shell> make
     shell> make install
     shell> cp support-files/my-medium.cnf /etc/my.cnf
     shell> cd /usr/local/mysql
     shell> chown -R mysql .
     shell> chgrp -R mysql .
     shell> bin/mysql_install_db --user=mysql
     shell> chown -R root .
     shell> chown -R mysql var
     shell> bin/mysqld_safe --user=mysql &

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h test.nchannel.net password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com