MySQL¿Í»§¶ËÃüÁîÐÐÓ¦Óü¼ÇÉ
1.ʵÏÖTAB¼ü²¹È«
SHELL>vi /etc/my.cnf
[mysql]
#no-auto-rehash
auto-rehash
SHELL>reboot mysqld
note: 1.ÒªÏÈuseµ½Ä³¸öÊý¾Ý¿âÏ£»2.Òª²¹È«µÄ¹Ø¼ü×ÖÐèÒª´óд¡£
2.promptÈòÙ×÷¸ü¼ÓÇå³þ
mysql>prompt \u@\h(\d) \r:\m:\s (ÁÙʱ)
[mysql] £¨³¤¾Ã£©
prompt=\\u@\\h
3.pagerÈÃä¯ÀÀ¸ü´ÓÈÝ
mysql>pager less | pager more
mysql>nopager
4.timestampÓëunixtimeÖ®¼äµÄת»»
unix_timestamp ------ from_unixtime
1270716930 -----> 2010-04-08 16:55:30
5.binaryÈÃ×Ö´®±È½ÏÊÇÇø·Ö´óСд
6.group by with rollup ͳ¼Æ×ܹ²¼Ç¼Êý£¬×îºóÒ»Ìõ¼Ç¼Ϊ×ÜÊý
7.group_concatÈüǼÔÚÒ»ÐÐÏÔʾ
mysql> select group_concat(title separator ',') from tjob;
+----------------------------------------+
| group_concat(title separator ',') |
+----------------------------------------+
| 11,22,33,aa,bb,cc,AA,BB,CC |
+----------------------------------------+
1 row in set (0.00 sec)
8.order by if ÅÅÐòʱ½«Ä³ÁÐÖÐÌض¨ÖµÅÅÔÚ×îÇ°£¬ÀýÈçÎÒÔÚÅÅÐòÖÐÒª°Ñaa·ÅÔÚ×îÇ°Ã棺
select title from tjob order by if(title='aa',0,1),title;
+-------+
| title |
+-------+
| aa |
| AA |
| 11 |
| 22 |
| 33 |
| bb |
| BB |
| cc |
| CC |
+-------+
Ïà¹ØÎĵµ£º
ÔÚ¿´ÏîÄ¿µÄÊÇ¿´µ½mysql°æ±¾µÄÏîÄ¿£¬·¢ÏÖÖ´ÐжàÌõsqlÓï¾äÊǶ¼ÊÇÏÈ·ÖÀëÒ»ÌõÌõµÄÊý¾Ý¿âÔÙÒ»ÌõÌõÖ´ÐУ¬ÎÒÏëÓ¦¸ÃÓа취һÌõÌõÖ´ÐеİÉ
ËùÒÔ½ñÌìÌØÒâµÄ²éÕÒÁËÒ»ÏÂ
ÔÚjdbcÏÂ˵¿ÉÒÔÉèÖÃÁ¬½Ó×Ö·û´®µÄʱºòÉèÖÃÒ»ÏÂ
ÉèÖóÉÈçÏ嵀 jdbc:mysql://192.168.3.180/sample?user=root&password=&allowMultiQueries=true
¾Í¿ÉÒÔÖ´Ð ......
connect·½·¨ÊÇjava.sql.Driver½Ó¿ÚÖж¨ÒåµÄ·½·¨£¬Èç¹ûÁ¬½ÓµÄÊý¾Ý¿â²»Í¬£¬ÄÇôΪ²»Í¬µÄÊý¾Ý¿â±àдJDBCÇý¶¯½«±äµÃºÜÁé»î£¬ÊµÏÖDriver½Ó¿Ú¼´¿É¡£Á¬½ÓÊý¾Ý¿âʱÊ×ÏȵÃ×°ÔØJDBCÇý¶¯£¬Ò²¾ÍÊǵ÷Óà Class.forName(“com.mysql.jdbc.Driver”)·½·¨£¬ÔÚµÚһƪÖÐÒѾÁгömysql jdbc DriverÀàµÄÔ´Â룬´ËÀà¼Ì³ÐNonRegisteringD ......
²âÊÔ»·¾³£ºmysql 5.0.45 ¡¾×¢£º¿ÉÒÔÔÚmysqlÖÐͨ¹ýmysql> SELECT VERSION();À´²é¿´Êý¾Ý¿â°æ±¾¡¿ÕûÀí£ºWebjx.Com Ò»¡¢Á¬½ÓMYSQL¡£¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë 1¡¢Á¬½Óµ½±¾»úÉϵÄMYSQL¡£Ê×ÏÈ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼mysql\bin£¬ÔÙ¼üÈëÃüÁîmysql -u root -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂë.×¢ÒâÓû§ÃûÇ°¿ÉÒÔÓпոñ ......
Á¬½Ó£ºmysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë £¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
¶Ï¿ª£ºexit £¨»Ø³µ£©
´´½¨ÊÚȨ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by \"ÃÜÂë\"
ÐÞ¸ÄÃÜÂ룺mysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
ɾ³ýÊÚȨ: revoke select,insert,update,delete om *.* from ......
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Li ......