mysql install in Ubuntu:
- sudo apt-get update
- sudo apt-get install mysql-server
- modify for my.cnf (in /etc/mysql) :
- bind-address = 10.1.1.1
- allow remote hosts to use root to login:
- mysql -u root -p
- mysql>use mysql;
- mysql>update user set host = '%' where user = 'root';
- mysql>flush privileges;
- replications:
- source db:
- in my.cnf:
- log-bin=C:/Program Files/MySQL/MySQL Server 5.0/log/replication.log
- server-id=1
- restart mysql
- mysql --user=user --password=password
- FLUSH TABLES WITH READ LOCK;
- SHOW MASTER STATUS;
- keep File, Position
- mysqldump --user=user --password=password --all-databases --master-data | gzip > dbdump.db.gz
- 備份部份 DB: mysqldump --databases db1 db2
- after mysqldump,
- mysql>UNLOCK TABLES;
- slave db:
- gunzip < dbdump.db.gz | mysql -p
- or mysql --user=user --password=password < dbdump.db
- show slave status
- in Ubuntu, mysql table name 預設是區分大小寫:
- (in my.cnf) lower_case_table_names=1 不區分大小寫
others:
- ubuntu 時間設定:
- 如果有 ntp service: service ntp stop
- ntpdate xx.xx.xx.xx (time server)