Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎ±¸·ÝMysqlÊý¾Ý¿â

 
mysqldump -u[user] -p[password] [databasename] > [dump_name]
ÔÚ½« dump_name Õâ¸öµµ°¸¸´ÖƵ½Áíһ̨¼ÆËã»úÉÏ
Áíһ̨¼ÆËã»úÉÏÏȽøÈëmysql
½¨Á¢Ò»¸ö database ÔÙÖ´ÐÐÏÂÁÐÖ¸Áî
mysql -u[user] -p[password] [database_name] < [dump_name]


MYSQL¼¸ÖÖ±¸·Ý·½·¨¸ÅÊö
MysqlÊý¾Ý
¿â±¸·ÝÖ÷ÒªÓÐ4ÖÖ·½·¨£º
1¡¢ mysqldump
2¡¢ Ö±½Ó¿½±´(cp¡¢tar,gzip,cpio)
3¡¢ mysqlhotcopy
4¡¢ ͬ²½¸´ÖÆ

mysqldumpÉú³ÉÄܹ»ÒÆÖ²µ½ÆäËü»úÆ÷µÄÎı¾Îļþ£¬È±Ê¡µØ£¬ÎļþÄÚÈÝ°üº¬´´½¨ÕýÔÚÇãµ¹µÄ±íµÄCREATEÓï¾äºÍ°üº¬±íÖÐÐÐÊý¾ÝµÄINSERTÓï¾ä¡£Ò²
¾ÍÊÇ˵£¬mysqldump²úÉúµÄÊä³ö¿ÉÔÚÒÔºóÓÃ×÷mysqlµÄÊäÈëÀ´Öؽ¨Êý¾Ý¿â¡£mysqldump±ÈÖ±½Ó¿½±´ÒªÂýЩ¡£
ʹÓÃÖ±½Ó¿½±´£¬Èç¹ûÕýÔÚ±¸·ÝµÄ±íÕý±»¶Áд¾ÍÈÝÒ×µ¼Ö±íË𻵣¬¶øÇÒ²»½¨Òé¶Ôisam±íʹÓÃÖ±½Ó¿½±´µÄ·½·¨À´±¸·Ý£¬ÒòΪISAM±íÖ»ÄÜÔÚÏàËƵÄÓ²¼þ½á¹¹µÄ»úÆ÷ÉÏ¿½±´¡£

1¡¢mysqldump±¸·Ý:
ʹÓ÷½·¨£ºmysqldump [OPTIONS] database [tables]

Êä³öÎļþµÄ¿ªÍ·¿´ÆðÀ´ÏóÕâÑù£º
# MySQL Dump 6.0
#
# Host: localhost Database: samp_db
#---------------------------------------
# Server version 3.23.2-alpha-log
#
# Table structure for table 'absence'
#
CREATE TABLE absence(
student_id int(10) unsigned DEFAULT '0' NOT NULL,
date date DEFAULT '0000-00-00' NOT NULL,
PRIMARY KEY (student_id,date)
);
#
# Dumping data for table 'absence'
#
INSERT INTO absence VALUES (3,'1999-09-03');
INSERT INTO absence VALUES (5,'1999-09-03');
INSERT INTO absence VALUES (10,'1999-09-08');
......¡¡
ÎļþʣϵIJ¿·ÖÓиü¶àµÄINSERTºÍCREATE TABLEÓï¾ä×é³É¡£Àý£º
%mysqldump samp_db >/opt/mysqldatabak/samp_db.2006-5-15
%mysqldump samp_db | gzip >/usr/archives/mysql/samp_db.1999-10-02.gz #²úÉúѹËõ±¸·Ý


Ïà¹ØÎĵµ£º

linux±¸·ÝmysqlÊý¾Ý¿â

¡¡MYSQL¶¨ÆÚ±¸·ÝÊÇÒ»ÏîÖØÒªµÄ¹¤×÷£¬µ«È˹¤²Ù×÷Ì«·±Ëö£¬Ò²ÄѱÜÃâÓÐËùÊè©£¬Ê¹ÓÃÏÂ
ÃæµÄ·½·¨¼´¿ÉÈÃϵͳ¶¨ÆÚ±¸·ÝÊý¾Ý¡£
¡¡¡¡1¡¢´´½¨±¸·ÝÎļþ¼Ð
¡¡¡¡#cd /www
¡¡¡¡#makedir backup
¡¡¡¡2¡¢±àдÔËÐнű¾
¡¡¡¡#vi autobackup
¡¡¡¡Ð´ÈëÒÔÏÂÄÚÈÝ£º
¡¡¡¡filename=`date +%Y%m%d`
¡¡¡¡mysql_bin_dir/mysqldump –opt da ......

¡¾×ª¡¿ÔÚWindowsÉÏÅäÖò¢ÕûºÏPHPºÍMySQL¾­µä½Ì³Ì

ÔÚΪÓû§Ìṩ¶¯Ì¬ÄÚÈÝ·½Ã棬PHPºÍMySQLÊÇÒ»¸öÇ¿´óµÄ×éºÏ¡£ÕâЩÄêÀ´£¬ÕâÁ½Ïî²úÆ·ÒѾ­¿çÔ½ÁËËüÃÇ×î³õµÄÓ¦ÓÃÎę̀£¬ÏÖÔÚ£¬Ò»Ð©ÊÀ½çÉÏ×æµÄÍøÕ¾Ò²ÔÚÓ¦ÓÃËüÃÇ¡£ËäÈ»ËüÃǵ±³õ¶¼ÊÇ¿ªÔ´Èí¼þ£¬Ö»ÄÜÔÚUNIX/LinuxÉÏÔËÐУ¬µ«¾­¹ýÏ൱һ¶ÎʱÆڵķ¢Õ¹£¬ËüÃÇÒÑÄÜÔÚWindowsƽ̨ÉÏÔËÐС£
ÔÚ±¾ÎÄÖУ¬ÎÒ½«Öð²½ÎªÄãÃÇ˵Ã÷ÈçºÎÔÚWindows»·¾³ÖÐ ......

MySQL µÄ×Ô¶¯¶Ï¿ªÁ¬½ÓÎÊÌâ

 MySQL »á×Ô¶¯¶Ï¿ª IDLE ʱ¼ä³¬¹ý 8 СʱµÄÊý¾Ý¿âÁ¬½Ó£¬´Ó¶øµ¼ÖÂһЩ»ùÓÚÊý¾Ý¿âÁ¬½ÓµÄÓ¦ÓóÌÐò£¬ÌرðÊÇ WEB Ó¦ÓóÌÐò³ö´í¡£
ÓÐÁ½¸ö°ì·¨¿ÉÒÔ½â¾öÕâ¸öÎÊÌ⣺
µÚÒ»¸ö°ì·¨ÊÇÐÞ¸Ä MySQL µÄÅäÖòÎÊý¡£Õâ¸ö²ÎÊýµÄÃû³ÆÊÇ wait_timeout
£¬ÆäĬÈÏֵΪ 28800(µ¥Î»Ãë)£¬¸ÕºÃ¾ÍÊÇ 8 Сʱ¡£ÆäÒâÒåΪ¹Ø±ÕÒ»¸öÁ¬½Ó֮ǰÔÚÕâ¸öÁ¬½ÓÉϵ ......

ÎÞ·¨ÔØÈë mysql À©Õ¹£¬Çë¼ì²é PHP ÅäÖá­¡­½â¾ö°ì·¨

PS:ÎÒ½ñÌìÅäÖà ·þÎñÆ÷µÄʱºò³öÏÖµÄÎÊÌâ¾ÍÊÇÕâ¸ö£¬µ«ÊÇÕÕ×Å·½·¨¶¼×öÁË£¬Ñ¾µÄ¡£¡£»¹ÊÇûÓ㬼«¶ÈÓôÃÆËÀ¡£¡£°¥¡£¡£¡£ÎÒÒ²²»ÖªµÀʲôԭÒòÄØ¡£¡£¿ÉÄܵÄÔ­Òò¶¼ÕÒ¹ýÁË¡£¡£ÓôÃÆ°¡`~
apache2+mysql+php5+phpmyadminÅäÖÃÎÊÌ⣺ÎÞ·¨¼ÓÈëmysqlÀ©Õ¹£¬Çë¼ì²éphpÅäÖÃ...
°²×°Íêapache2+mysql+php5ºó£¬°²×°phpmyadmin²¢ÅäÖúÃÒÔºó£¬ÔÚä¯À ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ