CentOSÏÂMySql 5.0.xµÄ°²×°¡¢ÓÅ»¯¼°°²È«ÉèÖÃ
groupadd mysql
н¨Ò»¸öÃûΪmysqlµÄÓû§×é
useradd -g mysql mysql
ÔÚmysqlÓû§×éÏÂн¨Ò»¸öÃûΪmysqlµÄÓû§
gunzip ½âѹÏÂÔص½µÄ.gzÎļþ
cd mysql-VERSION
½øÈë½âѹºóµÄĿ¼
CFLAGS="-O3 -mcpu=pentium4" CXX=gcc CXXFLAGS="-O3 -march=pentium4 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/home/mysql/ --without-debug --with-unix-socket-path=/home/mysql/tmp/mysql.sock --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --with-extra-charsets=gbk,gb2312,utf8 --without-innodb --without-isam --with-pthread --enable-thread-safe-client
ÅäÖÃmysql
gccµÄÏà¹Ø²ÎÊý£º
-O3 \
-O
-O1
ÓÅ»¯.¶ÔÓÚ´óº¯Êý,ÓÅ»¯±àÒëÕ¼ÓÃÉÔ΢¶àµÄʱ¼äºÍÏ൱´óµÄÄÚ´æ.
²»Ê¹ÓÃ`-O'Ñ¡Ïîʱ,±àÒëÆ÷µÄÄ¿±êÊǼõÉÙ±àÒëµÄ¿ªÏú,ʹ±àÒë½á¹ûÄܹ»µ÷ÊÔ.Óï¾äÊǶÀÁ¢µÄ:Èç¹ûÔÚ Á½ÌõÓï¾äÖ®¼äÓöϵãÖÐÖ¹³ÌÐò,Äã¿ÉÒÔ¶ÔÈκαäÁ¿ÖØи³Öµ,»òÕßÔÚº¯ÊýÌåÄڰѳÌÐò¼ÆÊýÆ÷Ö¸µ½ÆäËûÓï¾ä,ÒÔ¼°´ÓÔ´³ÌÐòÖÐ ¾«È·µØ»ñÈ¡ÄãÆÚ´ýµÄ½á¹û.
²»Ê¹ÓÃ`-O'Ñ¡Ïîʱ,Ö»ÓÐÉùÃ÷ÁËregisterµÄ±äÁ¿²Å·ÖÅäʹÓüĴæÆ÷.±àÒë½á¹û±È²»Óà `-O'Ñ¡ÏîµÄPCCÒªÂÔÑ·Ò»³ï.
ʹÓÃÁË`-O'Ñ¡Ïî,±àÒëÆ÷»áÊÔͼ¼õÉÙÄ¿±êÂëµÄ´óСºÍÖ´ÐÐʱ¼ä.
Èç¹ûÖ¸¶¨ÁË`-O'Ñ¡Ïî, `-fthread-jumps'ºÍ`-fdefer-pop'Ñ¡Ï±» ´ò¿ª.ÔÚÓÐdelay slotµÄ»úÆ÷ÉÏ, `-fdelayed-branch'Ñ¡Ï±»´ò¿ª.ÔÚ¼´Ê¹Ã»ÓÐÖ¡Ö¸Õë (frame pointer)Ò²Ö§³Öµ÷ÊԵĻúÆ÷ÉÏ, `-fomit-frame-pointer'Ñ¡Ï±»´ò¿ª.ijЩ»úÆ÷ÉÏ »¹¿ÉÄÜ»á´ò¿ªÆäËûÑ¡Ïî.
-O2
¶àÓÅ»¯Ò»Ð©.³ýÁËÉæ¼°¿Õ¼äºÍËٶȽ»»»µÄÓÅ»¯Ñ¡Ïî,Ö´Ðм¸ºõËùÓеÄÓÅ»¯¹¤×÷.ÀýÈç²»½øÐÐÑ»·Õ¹¿ª(loop unrolling)ºÍº¯ÊýÄÚǶ(inlining).ºÍ-OÑ¡Ïî±È½Ï,Õâ¸öÑ¡Ïî¼ÈÔö¼ÓÁ˱àÒëʱ¼ä,Ò²Ìá¸ßÁËÉú³É´úÂëµÄ ÔËÐÐЧ¹û.
-O3
ÓÅ»¯µÄ¸ü¶à.³ýÁË´ò¿ª-O2Ëù×öµÄÒ»ÇÐ,Ëü»¹´ò¿ªÁË-finline-functionsÑ¡Ïî.
-O0
²»ÓÅ»¯.
Èç¹ûÖ¸¶¨Á˶à¸ö-OÑ¡Ï²»¹Ü´ø²»´øÊý×Ö£¬×îºóÒ»¸öÑ¡Ïî²ÅÊÇÉúЧµÄÑ¡Ïî¡£
-mcpu=pentium4 \¸ù¾ÝCPUÀàÐÍÓÅ»¯±àÒ룬¿ÉÒÔÈÃÄãµÄmysq±íÏÖ¸üºÃ£¡¿ÉÑ¡ÏîÄ¿ºÜ¶à£ºi386, i486, i586, i686, pentium, pentium-m
Ïà¹ØÎĵµ£º
·µ»ØÒ»¸ö½á¹ûÈ«ÊÀ½ç¶¼ÖªµÀÔõô´¦Àí£¬¹Ø¼üÊÇ·µ»Ø¶à¸ö½á¹û¼¯¾Í²»ºÃ°ìÁË£¬ÏÂÃæÓÐÒ»½â¾ö°ì·¨
´æ´¢¹ý³Ì´úÂë
DELIMITER $$;
DROP PROCEDURE IF EXISTS `test`.`sp_test`$$
CREATE PROCEDURE `test`.`sp_test` ()
BEGIN
select * from `user`.`user` limit 0, 50;
select coun ......
1 µ¼³ö:
½øÈëÃüÁîÐÐ: Ö´ÐÐ
mysqldump -u username -p password –all-databases > all.sql
Ïêϸ²ÎÊý:
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
2 µ¼Èë
½øÈëmysql -u username -p password
Ö´ÐÐsource all.sql;
......
MySQL Workbench ÊÇ MySQL ×î½üÊͷŵĿÉÊÓÊý¾Ý¿âÉè¼Æ¹¤¾ß¡£Õâ¸ö¹¤¾ßÊÇÉè¼Æ MySQL Êý¾Ý¿âµÄרÓù¤¾ß¡£
ÄãÔÚ MySQL Workbench Öн¨Á¢µÄ±»³Æ֮ΪÎïÀíÊý¾ÝÄ£ÐÍ¡£Ò»¸öÎïÀíÊý¾ÝÄ£ÐÍÊÇÕë¶ÔÒ»¸öÌض¨ RDBMS ²úÆ·µÄÊý¾ÝÄ£ÐÍ£»±¾ÎÄÖеÄÄ£Ðͽ«¾ßÓÐһЩ MySQL µÄ¶ÀÌع淶¡£ÎÒÃÇ¿ÉÒÔʹÓÃËüÉú³É£¨forward-engineer£©Êý¾Ý¿â¶ÔÏ󣬳ýÁË°üº¬± ......
ÓÉÓÚ×î½üÒ»Ö±ÔÚÁ˽âmysql¡£¸÷ÖÖ±íÀàÐ͵ÄÊý¾Ý´æ´¢ÒÔ¼°Ïà¹ØÏÞÖƾÍÊDZØÐëÁ˽âµÄ·½ÃæÁË¡£
×Ô¼ºµÄ·þÎñÆ÷»·¾³£ºOS Cent OS ext3£¬memory 4G£¬ disk 2T block size 4K¡£
¾µ÷²é£¬linuxÏÂÎļþ×î´óÊÇ´æÔÚÏÞÖƵġ£È¥googleÉÏËÑÁËËÑ£¬´ó¼Ò˵·¨²»Ò»£¬×îÖÕ×Ô¼º»¹ÊÇÕÒµ½±È½Ï¹Ù·½µÄ˵¡£Ïê¼ûhttp://en.wikipedia.org/wiki/Ext3 ËùÒÔ× ......
CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£s ......