mysqlÖÐcountº¯Êý×¢ÒâÊÂÏî
񡜧
CREATE TABLE `user` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(10) DEFAULT NULL,
`password` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
ÆäÖÐÓÐÊý¾ÝΪ£º
1 name1 123456
2 name2 123456
3 name3 123456
4 name4 NULL
ÒÔÏÂÈý¸ö²éѯ·µ»Ø¼¸ÄØ£¿
£¨1£©select count(*) from `user`
£¨2£©select count(name) from `user`
£¨3£©select count(password) from `user`
´ð°¸ÊÇ£º4,4,3
ÒòΪ£º
£¨1£©count(*)ÊǶÔÐÐÊýÄ¿½øÐмÆÊý£¬ËùÒÔµ±È»ÊÇ4
£¨2£©count(column_name)ÊǶÔÁÐÖв»Îª¿ÕµÄÐнøÐмÆÊý£¬ËùÒÔcount(name)=4£¬¶øcount(password)=3
Ïà¹ØÎĵµ£º
Êý¾Ý¿âÌØµã
££Ê¹ÓÃpartition£¬´æÔÚÉϰٸö·ÖÇø
££½¨±íʱָ¶¨ÁËdata_dirºÍindex_dir£¬Êý¾Ý²»ÊÇ´æ´¢ÔÚĬÈÏλÖ㬶øÊÇÔÚmysqldµÄÊý¾ÝĿ¼ÏÂlinkµ½ÕæÕýµÄÊý¾ÝÎļþ
±¸·Ý»Ö¸´ÒªÇó
££±¸·Ý³öÀ´µÄÊý¾Ý»Ö¸´Ê±Òª»Ö¸´³É²»Í¬µÄ±íÃû
££»Ö¸´³öÀ´µÄÊý¾Ýʵ¼Ê´æ´¢Î»ÖÃÒ²Òª´æ´¢ÔÚÓëÔ±í²»Í¬µÄλÖÃ
ÎÊÌâ
Èç¹ûÖ±½Ómysqldump£sourc ......
1.mysqlµ¼³öÊý¾Ý¿âÃüÁî
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû (±íÃû) > c:\\ÎļþÃû.sql
2.mysqlµ¼ÈëÊý¾Ý¿âÃüÁî
£¨1£©½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִÐÐÈçÏÂÃüÁîÔÙµ¼È룺set names utf8
£¨2£©µÇ¼mysql£¬Ö´ÐÐÈçÏÂÃüÁ
mysql> source c:\\ÎļþÃû.sql;
3½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִР......
1. Á¬½Ómysql:
mysql -h Ö÷»úµØÖ· -u Óû§Ãû £p
2.Í˳ömysql:exit
3. ÐÞ¸ÄÃÜÂë:
mysqlbinmysqladmin -uroot -p(oldpassword) password newpassword
4.Ôö¼ÓÓû§£º
Ìí¼ÓÒ»¸öÓû§test1 ÃÜÂëΪABC£»ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ,²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬Èë
mysql,È»ºó¼üÈëÒÔÏÂÃü ......
¶ÔmysqlµÄÓÅ»¯²»ÔÚÐУ¬¸ã¹ý¼¸´ÎÓÅ»¯£¬µ«ÊǶ¼²»ÊǺÜÀíÏ룬»¹ÊÇÀË·Ñ×ÊÔ´Ì«¶à¡£Ò»Ö±·¢ÏÖÎÒµÄmysqlµÄ»º´æÃüÖÐÂʼ«²î£¬Çé¿öÁ¼ºÃµÄʱºòµ½´ï¹ý60-70%£¬µ«ÊÇÔËÐÐʱ¼äÒ»³¤£¬Ö»ÓÐ10-20%¡£²éÁËһЩ×ÊÁÏ£¬¹ØÓÚ»º´æµÄһЩ²ÎÊý¼Ç¼
mysql> SHOW VARIABLES LIKE ‘%query_cache%’;
+—————&m ......
ÐÂÔöÓû§£º
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ÄãµÄÔ¶¶Ëip' IDENTIFIED BY 'ÄãµÄÃÜÂë' WITH GRANT OPTION;
È磺
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.19.220' IDENTIFIED BY '123456' WITH GRANT OPTION;
µÇ¼µ½ÐÂÔöµÄÓû§£º£¨¼ÙÈçÔÊÚȨ»úµÄIPΪ10.10.19.222£©
mysql -uroot -p123456&n ......