ÐÞ¸ÄmysqÁ¬½ÓÊýºÍÆô¶¯mysql·þÎñ
my.cnf »òÕßÊÇ my.ini
ÔÚ[MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)d]ÅäÖöÎÌí¼Ó£º
max_connections = 1000
±£´æ£¬ÖØÆôMySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)·þÎñ¡£
È»ºóÓÃÃüÁ
MySQL(ºÍPHP´îÅäÖ®×î¼Ñ×éºÏ)admin -uroot -p variables
ÊäÈërootÊý¾Ý¿âÕ˺ŵÄÃÜÂëºó¿É¿´µ½
| max_connections | 1000 |
Æô¶¯mysql·þÎñ
RedHat Linux (Fedora Core/Cent OS)
1.Æô¶¯£º/etc/init.d/mysqld start
2.Í£Ö¹£º/etc/init.d/mysqld stop
3.ÖØÆô£º/etc/init.d/mysqld restart
Debian / Ubuntu Linux
1.Æô¶¯£º/etc/init.d/mysql start
2.Í£Ö¹£º/etc/init.d/mysql stop
3.ÖØÆô£º/etc/init.d/mysql restart
Windows
1.µã»÷“¿ªÊ¼”->“ÔËÐД£¨¿ì½Ý¼üWin+R£©
2.Æô¶¯£ºÊäÈë net stop mysql
3.Í£Ö¹£ºÊäÈë net start mysql
Ìáʾ
Redhat Linux Ò²Ö§³Öservice command£¬
Æô¶¯£º# service mysqld start
Í£Ö¹£º# service mysqld stop
ÖØÆô£º# service mysqld restart
Windowsϲ»ÄÜÖ±½ÓÖØÆô(restart)£¬Ö»ÄÜÏÈÍ£Ö¹£¬ÔÙÆô¶¯¡£
Ïà¹ØÎĵµ£º
×î½üÒµÎñ·ÃÎÊÁ¿±È½Ï´ó£¬Êý¾Ýͳ¼ÆÀàµÄ²Ù×÷¶¼Çл»µ½mysqlµÄ±¸»úÉÏÈ¥ÁË£¬±¸»úµÄ¶Á²Ù×÷²»»áÓ°ÏìÖ÷¡¢±¸Ö®¼äµÄÈȱ¸µÄ
ÏÂÃæÁÐһϾßÌåµÄÔÀí£º
ÒªÏëÓúÃÒ»¸öϵͳ£¬Àí½âÆäʵÏÖÔÀíÊǷdz£ÖØÒªµÄÊÂÇ飬ֻÓÐÀí½âÁËÆäʵÏÖÔÀí£¬ÎÒÃDzÅÄܹ»Ñﳤ±Ü¶Ì£¬ºÏÀíµÄÀûÓ㬲ÅÄܹ»´î½¨³ö×îÊʺÏÎÒÃÇ×Ô¼ºÓ¦Óû·¾³µÄϵͳ£¬²ÅÄܹ»ÔÚϵͳʵʩ֮ºó¸üºÃµ ......
¹ØÓÚMySQLÊÂÎñ´¦Àíѧϰ¼Ç
START TRANSACTION, COMMITºÍROLLBACKÓï·¨
START TRANSACTION | BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET AUTOCOMMIT = {0 | 1}
START
TRANSACTION»òBEGINÓï¾ä¿ÉÒÔ¿ªÊ¼Ò»ÏîеÄÊÂÎñ¡£COMMIT¿ÉÒÔÌá½»µ±Ç°ÊÂÎñ ......
netbeans6.7ÖÐÏòmysql5ÖвåÈëÖÐÎÄÊý¾ÝʱÏÔʾ”data too long for column“µÄÎÊÌâ¡£
ÎÒµÄmysqlÖÐ×Ö·ûµÄÉèÖÃʱutf-8£¬²¢ÇÒÔÚ¿ØÖÆ̨ÖпÉÒÔ²åÈëÖÐÎÄÊý¾Ý²¢ÏÔʾ£¬µ«ÔÚnetbeansÖвåÈëÊý¾Ýʱȴ×ÜÊÇÏÔʾ”data too long for column“¡£»ù±¾¿ÉÒÔÅжÏÊÇÓÉÓÚnetbeansºÍmysqlÖ®¼äµÄÊý¾Ý½»»»³öÁ ......
¼ÙÉèÓбí tb1
ID £ü name£ü
----+--------+
1 £ü2toon£ü
2 £ü1*xyz£ü
Óï¾ä1£º
select * from tb1 where ID='2toon' or name ='2toon';
mysql·þÎñÆ÷ÔÚijģʽÏ£¬¿ÉÒÔÖ´ÐÐÕâÌõ¾ä£¬¾Í³É¹¦·µ»ØÁ½Ìõ¼Ç¼£¬ÔÒòÔÚÓÚ ID=‘2toon’ ¼ÓÁ˵¥ÒýºÅ£¬mysql½âÊÍΪ ID=2.
Óï¾ä2
select * fro ......
ÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
¡¡¡¡mysql> SELECT something from table
¡¡¡¡WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
select TO_DAYS(NOW());
select now() ;
¡¡¡¡DAYOFWEEK( ......