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

Linux Ï MysqlÅäÖÃÎÊÌ⼯

Ò»Ö±ÒÔÀ´ÎÒµÄÎÄÕ¶¼ÊÇÒÔ¹¤×÷±Ê¼ÇµÄÐÎʽ´æÔÚ¡£Õâ¶ÔÓÚ×Ô¼º¶ÁÆðÀ´Ã»Ê²Ã´´ó°­£¬µ«ÊǶÔÓÚÆäËû¶ÁÕß¿ÉÄܾÍÓÐЩÃÔã¡£ÎÒ¾¡Á¿¸Ä¸Ä£¬»»ÖÖ·½Ê½¡£
1. MySQL µÄ°æ±¾
Èç¹ûÒªÖ§³Ö·ÖÇø±í£¬ÔòÓ¦¸ÃʹÓà5.1.x ÒÔÉϵİ汾¡£Èç
mysql> show variables like '%version%';
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| protocol_version        | 10                           |
| version                 | 5.1.45-community-log         |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86_64                       |
| version_compile_os      | unknown-linux-gnu            |
+-------------------------+------------------------------+
2. MySQL µÄ»ù±¾²ÎÊýÉ趨
´Ë´¦Éæ¼°µÄ²ÎÊýÊÇÔÚÓ¦ÓÃÖв»¶Ï¸üеġ£ÈçÏÂΪ /etc/my.cnf ²¿·ÖÄÚÈÝ
[mysqld]
datadir=/var/lib/mysql
datadir=/home/mysql/data
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
#old_passwords=1
#mysql 5.0 --log-slow-queries
#log-slow-queries=/var/log/mysql/slowquery.log
#log-queries-not-using-indexes=/var/log/mysql/noindex.log
#mysql 5.1
slow_query_log=1
slow_query_log_file=/var/log/mysql/slowquery.log
log-queries-not-using-indexes=1
#´´½¨Ï̳߳ØÀ´´¦Àí´óÁ´½ÓÁ¿µÄÓ¦ÓÃ
thread_cache_size=80
#¼Ó¿ì¿Í»§¶ËÁ´½ÓËÙ¶È,¿ÉÒÔÆÁ±ÎµôËùÓеÄip·´Ïò½âÎö
#µ±Ê±×¢Òâµ½´ËÎÊÌ⣬ÊÇÒòΪÔÚ show processlist µÄʱºò£¬·¢ÏÖÁË´óÁ¿µÄ user = 'unauthenticated user'Á´½Ó´æÔÚ¡£
#ÕâÊÇÒòΪmysqlÔÚ¿Í»§¶ËÁ´½Óʱ£¬»á·´Ïò²éѯipµÄhostname,


Ïà¹ØÎĵµ£º

LinuxÏÂÅú´¦ÀíÎļþ±àд


£¨1£©
linuxϵÄÅú´¦ÀíÎļþ£¬»ù±¾¾ÍÊÇshell½Å±¾Îļþ¡£
1.Ò»¸ö×î¼òµ¥µÄ½Å±¾Êéд·½·¨Îª£º
н¨Ò»¸öÎļþ£¬Ãû×ÖΪclean(×Ô¼º¶¨ÒåµÄÃû×Ö)£¬ÔÚÀïÃæ±àд
rm -fv *.o;ls -al;
(¿ÉÒÔдһЩshellÆÕͨÃüÁÃüÁîÓ÷ֺŸô¿ª)
 
2.Ö´Ðз½·¨
(1)ÔÚ¿ØÖÆ̨ÊäÈ룺
   sh clean
(2)ÏȸøÓë½Å±¾¿ÉÖ´ÐÐȨÏÞ£º
  ......

MySQL phpMyAdmin °²×°

Ê×ÏÈ°²×°phpMyadmin
[root@aladdin phpMyAdmin]# uname -a
Linux aladdin.leadtek.com.cn 2.6.32.11-99.fc12.i686.PAE #1 SMP Mon Apr 5 16:15:03 EDT 2010 i686 i686 i386 GNU/Linux
[root@aladdin phpMyAdmin]# yum info phpmyadmin
Loaded plugins: presto, refresh-packagekit
Installed Packages
Name &nbs ......

Mysql²éѯ·ÖÒ³

˵Ã÷£ºÕâÊÇÒ»¸öʵÀý£¬ÆäÖÐÓÐЩ¶«Î÷ÊÇ¿ÉÒÔ³éÈ¡³öÀ´µÄ£¬×÷Ϊһ¸ö¹«¹²µÄ·½·¨£¬¿ÉÊÇʵÏÖ¸´ÓÃ
public class TestService {
public static TestService test=null;
public static TestService getTestService(){
if(test==null){
test=new TestService();
}
return test;
}
public List getTest(int pageNo ......

MysqlÖÐcount(*),DISTINCTµÄʹÓ÷½·¨ºÍЧÂÊÑо¿

ÔÚ´¦ÀíÒ»¸ö´óÊý¾ÝÁ¿Êý¾Ý¿âµÄʱºò
ͻȻ·¢ÏÖmysql¶ÔÓÚcount(*)µÄ²»Í¬´¦Àí»áÔì³É²»Í¬µÄ½á¹û
±ÈÈçÖ´ÐÐ
SELECT count(*) from tablename
¼´Ê¹¶ÔÓÚǧÍò¼¶±ðµÄÊý¾ÝmysqlÒ²Äܷdz£Ñ¸Ëٵķµ»Ø½á¹û
¶ø¶ÔÓÚ
SELECT count(*) from tablename WHERE…..
mysqlµÄ²éѯʱ¼ä¿ªÊ¼ÅÊÉý
×Ðϸ²éÔÄÀÛÏÂÊÖ²á,·¢ÏÖµ±Ã»ÓÐWHEREÓï¾ä¶ÔÓÚÕ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ