[MYSQL] SQLDUMP

개발/MySql 2010. 10. 28. 11:16
mysql to mysql backup

#/usr/local/mysql/bin/mysqldump -hxxx.xxx.xxx.xxx -usqluser -psqlpwd sqldb | /usr/local/mysql/bin/mysql -uroot -C sqldb

'개발 > MySql' 카테고리의 다른 글

[MYSQL] 'table is full' 에러 날 때  (0) 2010.12.23
[MYSQL] 5.1이상에서 Partitioning ...  (0) 2010.12.16
[MYSQL] 상태 확인  (0) 2010.11.01
[MYSQL] SQLDUMP  (0) 2010.10.28
[MYSQL] DB 생성 및 계정 설정  (0) 2010.10.28
[MYSQL] REPLICATION  (0) 2010.10.28
Posted by 나랑살자
TAG dump, mysql

댓글을 달아 주세요

1. DB 생성
CREATE DATABASE sqldb default character set utf8;

2.계정 및 권한 생성
grant all privileges on sqldb.* to sqluser@'localhost' identified by 'passwd' with grant option;
grant all privileges on sqldb.* to sqluser@'%' identified by 'passwd' with grant option;
flush privileges;

3.권한 삭제
권한 삭제는 
REVOKE all on *.* from sqluser@host;

4.계정 삭제
drop user sqluser@host;


ALTEER DATABASE [DB] DEFAULT CHARACTER SET=UTF8;
ALTEER TABLE [TABLE] DEFAULT CHARACTER SET=UTF8;

'개발 > MySql' 카테고리의 다른 글

[MYSQL] 'table is full' 에러 날 때  (0) 2010.12.23
[MYSQL] 5.1이상에서 Partitioning ...  (0) 2010.12.16
[MYSQL] 상태 확인  (0) 2010.11.01
[MYSQL] SQLDUMP  (0) 2010.10.28
[MYSQL] DB 생성 및 계정 설정  (0) 2010.10.28
[MYSQL] REPLICATION  (0) 2010.10.28
Posted by 나랑살자

댓글을 달아 주세요

[MYSQL] REPLICATION

개발/MySql 2010. 10. 28. 11:13
REPLICATION
#MASTER
#vi /etc/my.cnf
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

#mysql
grant replication slave on *.* to 'backup'@'xxx.xxx.xxx.xxx' identified by 'dnsaud';

#SLAVE
#vi /etc/my.cnf

# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
server-id       = 2
#
# The replication master for this slave - required
master-host     =   db1
#
# The username the slave will use for authentication when connecting
# to the master - required
master-user     =   backup


>master db 를 slave로 복사
#/usr/local/mysql/bin/mysqldump -hxxx.xxx.xxx.xxx -ucutalk -pcutalk cutalkdb | /usr/local/mysql/bin/mysql -uroot -C cutalkdb

#/usr/local/mysql/bin/mysql
CHANGE MASTER TO MASTER_HOST='xxx.xxx.xxx.xxx', MASTER_PORT=3306,
    MASTER_USER='backup', MASTER_PASSWORD='dnsaud', master_log_file='mysql-bin.000007', master_log_pos=659277542;


#master_log_file 및 master_log_pos
show master status;
+------------------+-----------+--------------+------------------+
| File             | Position  | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+-----------+--------------+------------------+
| mysql-bin.000008 | 121100486 |              |                  |
+------------------+-----------+--------------+------------------+
1 row in set (0.00 sec)


'개발 > MySql' 카테고리의 다른 글

[MYSQL] 'table is full' 에러 날 때  (0) 2010.12.23
[MYSQL] 5.1이상에서 Partitioning ...  (0) 2010.12.16
[MYSQL] 상태 확인  (0) 2010.11.01
[MYSQL] SQLDUMP  (0) 2010.10.28
[MYSQL] DB 생성 및 계정 설정  (0) 2010.10.28
[MYSQL] REPLICATION  (0) 2010.10.28
Posted by 나랑살자

댓글을 달아 주세요