[Level 1] Testing notes for MySQL. (mysql commands)
#!/usr/bin/bash #ln -s /dev/null .mysql_history ## in my.cnf MYSQL_HISTFILE=/dev/null #export MYSQL_PS1="(\u@\h) [\d]> " ## mysql --prompt="(\u@\h) [\d]> " #mysql -u mysql mysql < ./test_mysql.sql #mysql -u root mysql < ./test_mysql.sql #mysql -u root --defaults-file=/etc/my.ini ## mysqlslap, benchmark test # mysqlslap -auto-generate-sql # use default script mysqlslap -a -c100 i10 -u root -p --engine=InnoDB,MyISAM,MEMORY,ARCHIVE ## mysqlcheck, for MyISAM, InnoDB, CSV and Archive. #mysqlcheck world; #mysqlcheck world City Country; #mysqlcheck --databases world test; #mysqlcheck --all-databases; ## bin-log #mysqlbinlog bin.000001 bin.000002 | more #mysqlbinlog bin.000001 bin.000002 | mysql #mysqlbinlog --start-datetime="2009-01-01 00:00:00" --stop-datetime="2009-01-01 23:59:59" bin.000001 bin.000002 | mysql #mysqlbinlog --start-position=1001 --stop-position=1999 bin.000001 bin.000002 | mysql ## purge binary logs #mysql> purge binary logs to 'mysql-bin.010'; # mysql-bin.010 will not be deleted. #mysql> purge binary logs before '2009-05-31 23:59:59'; ## mysqlhotcopy, for MyISAM not for Innodb ## perl script, need to install DBI module first #mysqlhotcopy world /var/archive #mysqlhotcoyp world./Country/ /var/archive mysql_multi mysql_multi --example # list example configuration ## replication mysqldump --master-data=2 ## option write to the dump file a comment ## line containing the replication coordinates, ## which can be used when setting up replication slaves. ## That line has this format: ## CHANGE MASTER TO MASTER_LOG_FILE='file_name', MASTER_LOG_POS=file_position;Wish this helps.
regards,
Stanley Huang
Comments
Post a Comment