LinuxÏÂMySQL¶¨ÆÚ×Ô¶¯±¸·ÝÊý¾Ý¿â
MySQL :: Linux ÏÂ×Ô¶¯±¸·ÝÊý¾Ý¿âµÄ shell ½Å±¾
Linux ·þÎñÆ÷ÉϵijÌÐòÿÌ춼ÔÚ¸üРMySQL Êý¾Ý¿â£¬ÓÚÊǾÍÏëÆðдһ¸ö shell ½Å±¾£¬½áºÏ crontab£¬¶¨Ê±±¸·ÝÊý¾Ý¿â¡£Æäʵ·Ç³£¼òµ¥£¬Ö÷Òª¾ÍÊÇʹÓà MySQL ×Ô´øµÄ mysqldump ÃüÁî¡£
½Å±¾ÄÚÈÝÈçÏ£º
#!/bin/sh
# File: /home/mysql/backup.sh
# Database info
DB_NAME="test"
DB_USER="username"
DB_PASS="password"
# Others vars
BIN_DIR="/usr/local/mysql/bin"
BCK_DIR="/home/mysql/backup"
DATE=`date %F`
# TODO
$BIN_DIR/mysqldump –opt -u$DB_USER -p$DB_PASS $DB_NAME | gzip > $BCK_DIR/db_$DATE.gz
È»ºóʹÓý«´Ë½Å±¾¼Óµ½ /etc/crontab ¶¨Ê±ÈÎÎñÖУº
01 5 * * 0 mysql /home/mysql/backup.sh
ºÃÁË£¬Ã¿ÖÜÈÕÁ賿 5:01 ϵͳ¾Í»á×Ô¶¯ÔËÐÐ backup.sh Îļþ±¸·Ý MySQL Êý¾Ý¿âÁË¡£
/home/www/inc/back
Ïà¹ØÎĵµ£º
1.ÔÚ´´½¨±íµÄͬʱ´´½¨Ë÷Òý
CREATE TABLE material(id INT NOT NULL, name char(40) NOT NULL, resistance INT, INDEX index1(id,name), UNIQUE INDEX index2(name))
µÚÒ»¸öË÷Òý£¬ÃûΪindex1£¬ÓÉidºÍnameÁ½¸ö×Ö¶Î×é³É¡£µÚ¶þ¸öË÷ÒýÖ»°üº¬name£¬²¢Ö¸Ã÷name×ֶεÄÖµ±ØÐëÊÇΨһµÄ¡£
2.²åÈëÊý¾Ý£¬¿ÉÒÔͨ¹ýÆäËûij ......
[Ô´´] MySQL Proxy ѧϰ±Ê¼Ç
×÷Õߣºheiyeluren
ʱ¼ä£º2008-1-28
²©¿Í£ºhttp://blog.csdn.net/heiyeshuwu
¡¾ ²âÊÔƽ̨ ¡¿
·þÎñÆ÷¶Ë£º
OS£ºFreeBSD 6.2
Lua£º 5.1.1
MySQL Server£º4.1.22-log
MySQL Proxy£º 0.6.0
¿Í»§¶Ë£º
OS£ºWindows XP Pro SP2
PHP£º PHP 5.2.4 (cli)
MySQL Client£º Ver 14.13 Distrib ......
MySQL FOR LINUX
Ïȼì²éϵͳÊÇ·ñ×°ÉÏÁËmysql£¬Èç¹ûÓн«ÆäжÔصô
rpm -qa | grep mysql
×¢ÒâmysqlµÄ´óСд£¬´óСд¶¼ÓпÉÄÜ
rpm -e --nodeps mysql*
Ò»¶¨ÒªÓÃ--nodepsжÔØ£¬²»¼ì²éÒÀÀµÐÔ¹Øϵ¡£
´´½¨Óû§mysql
groupadd mysql
useradd -g mysql mysql
passwd mysql
ÔÚ/usr/localϽ¨Á¢ mysql Îļþ¼Ð
È»ºó½«°²×°Î ......
³ÌÏà¹Øº¯Êý£º
pthread_attr_init()
pthread_attr_setschedpolicy()
pthread_attr_setschedparam()
pthread_attr_destroy()
¾ßÌåÓ¦ÓÃdemo£º
pthread_attr_init(&attr);
pthread_attr_setschedpolicy ......
Linux ¶àÏß³ÌͨÐÅ
Linux ¶àÏß³ÌͨÐÅ
Õª×Ô×ÊÁÏ£¨linux ÓëWindows²»Í¬£©
Ï̼߳äÎÞÐèÌرðµÄÊֶνøÐÐͨÐÅ£¬ÒòΪÏ̼߳ä¿ÉÒÔ¹²ÏíÊý¾Ý½á¹¹£¬Ò²¾ÍÊÇÒ»¸öÈ«¾Ö±äÁ¿¿ÉÒÔ±»Á½¸öÏß³ÌͬʱʹÓᣲ»¹ýҪעÒâµÄÊÇÏ̼߳äÐèÒª×öºÃͬ²½£¬Ò»°ãÓÃmutex¡£¿ÉÒԲο¼Ò»Ð©±È½ÏеÄUNIX/Linux±à³ÌµÄÊ飬¶¼»áÌáµ½PosixÏ̱߳à³Ì£¬±ÈÈ硶U ......