mysql³£ÓÃÃüÁî
mysql³£ÓÃÃüÁî
¹Ø±ÕÊý¾Ý¿â
/data01/mysql/bin/mysqladmin -p shutdown
µ¼³öÊý¾Ý¿â
/usr/local/mysql/bin/mysqldump -opt -uroot -p -h10.15.0.45 bbsdb > 20070918.bbsdb.sql
µ¼ÈëÊý¾Ý¿â
/usr/local/mysql/bin/mysql target_db_name < backup-file.sql
ÏÞÖÆÖ»ÓÐÄÚ²¿ip¿ÉÒÔÁ´½Ó
/usr/local/mysql/bin/mysqld_safe --bind-address=10.15.0.72 &
Êý¾Ý¿â°²×°
./configure --prefix=/usr/local/mysql --with-charset=gbk --with-collation=gbk_chinese_ci
Êý¾Ý¿âÐÞ±í
/usr/local/mysql/bin/myisamchk --safe-recover table_name
¸ü¸ÄmysqlÓû§ÃÜÂ룺
mysql -h 10.15.11.2 -u root -p
Enter password: ********
ERROR 1130 (00000): Host '10.15.11.2' is not allowed to connect to this MySQL server
½â¾ö°ì·¨£¬ÔÚ10.15.11.2»úÆ÷ÉÏÖ´ÐÐ
mysql>grant all on *.* to root@'%' identified by 'yourpassword';
mysql>flush privileges; //Ë¢ÐÂȨÏÞ
##########################################
mysql±¸·Ý½Å±¾
#!/bin/sh
BACK_HOME="/server/back/www.test_db" ####±¸·Ý¿â·Åµ½µÄĿ¼
MYSQLDUMP="/server/mysql/bin/mysqldump" ###ÃüÁî
MYSQLCMD="/server/mysql/bin/mysql"
DB_NAME_LIST_FILE="/server/back/www.test_db/dbnamelist" ###¿âÁбí
##########
TAR="/bin/tar"
MYSQL_SERVER="10.15.0.52" ###Òª±¸·ÝÖ÷»úipµØÖ·
###µ¼Êý¾Ý¿âÁбí
$MYSQLCMD -uzhp -p12345 -h $MYSQL_SERVER </root/showdbcmd.sql>$DB_NAME_LIST_FILE
############
TODAY=`date +%Y%m%d`
MONTH=`date "+%d"`
WEEK=`date "+%w"`
##################
cd $BACK_HOME
for i in `cat $DB_NAME_LIST_FILE`
do
if [ $i != "Database" ]
then
echo "start $i..."
$MYSQLDUMP -Q -uzhp -p12345 -h $MYSQL_SERVER $i >$TODAY.$i.sql && echo "$TODAY.$i.sql good" >>mail.txt ####µ¼¿âÃüÁî
fi
done
echo "start tar...."
$TAR cvzfp $TODAY.db.test.sql.tar.gz *.sql && echo "$TODAY smsdbgood" >> mail.txt
cd $BACK_HOME
rm -rf *.sql
###########################
A.my.cnfÅäÖÃ
±¾ÎÄÖеÄÅäÖö¼ÊÇ´Ó¡¶MySQL5ȨÍþÖ¸ÄÏ(3rd)¡·ÖÐÕª³³öÀ´µÄ£¬¸öÈËÈÏΪ¶ÔÓÚʹÓÃMySQLÊ®·ÖÓÐÓ᣷ÅÔÚ´Ë´¦·½±ã×Ô¼ºËæʱ²éÔÄ£¬Ò²Ï£Í
Ïà¹ØÎĵµ£º
bigint ´Ó -2^63 (-9223372036854775808) µ½ 2^63-1 (9223372036854775807) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 8 ¸ö×Ö½Ú¡£
int ´Ó -2^31 (-2,147,483,648) µ½ 2^31 - 1 (2,147,483,647) µÄÕûÐÍÊý¾Ý£¨ËùÓÐÊý×Ö£©¡£´æ´¢´óСΪ 4 ¸ö×Ö½Ú¡£int µÄ SQL-92 ͬÒå×ÖΪ integer¡£
smallint ´Ó -2^15 (-32,768) µ½ 2^15 - 1 (32,7 ......
mysql ibdata1ÎļþµÄËõС(2009-12-22 15:29:46)
±êÇ©£ºit
mysql ibdata1´æ·ÅÊý¾Ý£¬Ë÷ÒýµÈ£¬ÊÇMYSQLµÄ×îÖ÷ÒªµÄÊý¾Ý¡£
Èç¹û²»°ÑÊý¾Ý·Ö¿ª´æ·ÅµÄ»°£¬Õâ¸öÎļþµÄ´óСºÜÈÝÒ×¾ÍÉÏÁËG£¬ÉõÖÁ10+G¡£¶ÔÓÚijЩӦÓÃÀ´Ëµ£¬²¢²»ÊÇÌ«ºÏÊÊ¡£Òò´ËÒª°Ñ´ËÎļþËõС¡£
·½·¨£ºÊý¾ÝÎļþµ¥¶À´æ·Å¡£
²½Ö裺
1£¬±¸·ÝÊý¾Ý¿â
......
ÓÃrpm°ü°²×°µÄMySQLÊDz»»á°²×°/etc/my.cnfÎļþµÄ£¬
ÖÁÓÚΪʲôûÓÐÕâ¸öÎļþ¶øMySQLÈ´Ò²ÄÜÕý³£Æô¶¯ºÍ×÷Óã¬ÔÚµãÓÐÁ½¸ö˵·¨£¬
µÚÒ»ÖÖ˵·¨£¬my.cnfÖ»ÊÇMySQLÆô¶¯Ê±µÄÒ»¸ö²ÎÊýÎļþ£¬¿ÉÒÔûÓÐËü£¬ÕâʱMySQL»áÓÃÄÚÖõÄĬÈϲÎÊýÆô¶¯£¬
µÚ¶þÖÖ˵·¨£¬MySQLÔÚÆô¶¯Ê±×Ô¶¯Ê¹ÓÃ/usr/share/mysqlĿ¼ÏµÄmy-medium.cnfÎļþ£¬ÕâÖÖ˵·¨½ö ......
֮ǰ£¬Ò»Ö±À§ÄպܾõÄMySQLµÄÎÊÌâÒòΪÓÐÁËtcmallocºóµÃÒÔ½â¾ö¡£
ÎÊÌâÊÇ£ºÍøÕ¾·ÃÎÊÁ¿²»¸ß£¬¸ß·åʱ²¢·¢ÊýÔÚ300-400Ö®¼ä¡£CPU±È½Ï¸ß£¬ÔÚ30-80%Ö®¼ä²¨¶¯µÃÀ÷º¦£¬Ê¹ÓÃtopÃüÁî¿ÉÒÔ¿´µ½ÊÇmysql½ø³Ìµ¼Ö£¬Í¬Ê±ÓÃiostatºÍsar²é¿´iowaitÖµºÜ¸ßÔÚ20-30Ö®¼ä¡£
µ«ÊÇϵͳ»¹¿ÉÒÔÎȶ¨ÔËÐУ¬È»ºóÖÜÆÚÐԵijöÏÖswap·ÖÇøÕ¼ÓÃÂÊÅÊÉý£¬Ö±½Óµ¼Ö ......
±¸·ÝÓë»Ö¸´ÔÚÈκÎÊý¾Ý¿âÀïÃ涼ÊǷdz£ÖØÒªµÄÄÚÈÝ£¬ÌرðÊÇËæ×ÅÊý¾ÝÁ¿µÄÔö¼Ó£¬±¸·ÝÎÊÌâ»áÔ½À´Ô½Í»³ö£¬Òò´Ë£¬ºÃµÄ±¸·Ý·½·¨Ó뱸·Ý²ßÂÔÊǷdz£ÖØÒªµÄ¡£½áºÏÎÒËù×öµÄÏîÄ¿±¾Éí£¬ÏÂÃæÖ÷Òª¾Íwindowsƽ̨ÏÂMySQL(5.0)Êý¾Ý¿âµÄ³£Óñ¸·ÝÓë»Ö¸´×öһЩ×ܽᡣ
1 Ïà¹Ø×¼±¸¹¤×÷
......