In my blog, i would discuss the problem i face in daily routine. Following are some of them: mysql error, mysql replication, mysql database corrupted repair, innodb tablespace corruption, mysql storage engines, mysql optimization and tuning, reinstall mysql linux server, linux command for dummies, linux administration tips, mysql administration tips, Linux server benchmarking
Saturday, May 28, 2011
To modify subnet mask or IP address of LINUX Network interface - eth0
/etc/sysconfig-network-scripts/ifcfg-eth
e.g contents inside the file
TYPE=Ethernet
BOOTPRO=none
IPADDR=192.168.2.3
PREFIX=24
GATEWAY=192.168.2.1
DEFROUTE=yes
DNS1=192.168.2.1
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Auto eth0"
UUID=42b275d6-a04d-4898-8df1-cde310f3cal7
ONBOOT=yes
HWADDR=08:00:27:64:XX:XX
After modified the file, restart the "network" service
/sbin/service network restart
Wednesday, May 25, 2011
JAVA - Why you would use java.util.Calendar to get your NOW/ Current Time
MySQL - Setting MySQL Database Server for Production Server
To Install Perl for Fedora 14 - Dependencies Package as following
Thursday, May 19, 2011
Delete Files Older Than x Days on Linux
Sunday, May 15, 2011
Friday, May 13, 2011
MySQL Replication - To be review
1. Create c:\slave folder
2. Copy my.ini into C:\slave folder
3. Change port=3312 in my.ini
4. Create c:\slave\data folder
5. Copy mysql folder from mysql original data folder (Documents & Settings)
6. run "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install mysqlslave --defaults-file=C:\slave\my.ini
master my.ini
[mysqld]
log-bin=mysql-bin
server-id=1
slave my.ini
[mysqld]
server-id=2
master:
CREATE USER 'repl'@'localhost' IDENTIFIED BY 'slavepass';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'localhost';
FLUSH TABLES WITH READ LOCK;
c:\>mysqldump --port=3306 -uroot -ppassword --all-databases --lock-all-tables > dbdump.db
OR mysqldump --all-databases --master-data > c:/dbdump.db
UNLOCK TABLES;
slave:
mysql --port=3312 -uroot -ppassword < c:/dbdump.db
net start and stop both
Obtaining the Replication Master Binary Log Coordinates
master:
SHOW MASTER STATUS;
*identify binlog file and position
slave:
mysql --port=3311 -uroot -ppassword
show variables like 'port';
show variables like 'hostname';
show variables like 'server_id';
mysql>CHANGE MASTER TO
-> MASTER_HOST='localhost',
-> MASTER_USER='repl',
-> MASTER_PASSWORD='slavepass',
-> MASTER_PORT=3306,
-> MASTER_LOG_FILE='mysql-bin.000001',
-> MASTER_LOG_POS=332;
mysql>start slave
MASTER:
INSERT INTO World.City (Name, CountryCode) VALUES ('Selangor','MY');
SLAVE:
mysql>SELECT ID, Name FROM World.City WHERE name='Selangor';
Both Master & Slave:
Show Processlist;