Linux mysql ·þÎñÆ÷ÂýµÄÔÒò
Õ⼸ÌìLinux·þÎñÆ÷ºÜÂý,ºÜ׿±ÕÒ²»µ½½â¾ö°ì·¨!ºó°Ù¶ÈÏà¹Ø×ÖÑÛ,²éÕÒµ½ÊÇMySQLµÄÎÊÌâ,
ÈçÏÂΪ½â¾ö·½°¸
:
Á¬½ÓMySQLËÙ¶ÈÂýµÄ½â¾ö·½·¨.
PHPÔ¶³ÌÁ¬½ÓMYSQLËÙ¶ÈÂý,ÓÐʱԶ³ÌÁ¬½Óµ½MYSQLÓÃʱ4-20Ãë²»µÈ,±¾µØÁ¬½ÓMYSQLÕý³£,³öÏÖÕâÖÖÎÊÌâµÄÖ÷ÒªÔÒòÊÇ,ĬÈÏ°²×°µÄ
MYSQL¿ªÆôÁËDNSµÄ·´Ïò½âÎö,ÔÚMY.CNF(UNIX»òLINUXϵͳÏÂ)»òMY.INI(WINDOWSϵͳÏÂ)ÎļþµÄ[mysqld]ϼÓÈë
skip-name-resolveÕâÒ»¾ä¡£
ÔÚ¾ÖÓòÍøÄÚÁ¬½ÓÆäËû»úÆ÷µÄMYSQL,·¢ÏÖ
ËÙ
¶ÈÂýµÄºÜ,²»ÖªµÀʲôÔÒò,×ÜÓм¸ÃëµÄÑÓ³Ù.
ºóÀ´ÔÚÍøÉÏ·¢ÏÖ½â¾ö·½·¨£¬my.cnfÀïÃæÌí¼Ó
[mysqld]
skip-name-resolve
skip-grant-tables
ÕâÑùËٶȾͿìÁË!
skip-name-resolve
Ñ¡Ïî¾ÍÄܽûÓÃDNS½âÎö£¬Á¬½ÓËٶȻá¿ìºÜ¶à¡£²»¹ý£¬ÕâÑùµÄ»°¾Í²»ÄÜÔÚMySQLµÄÊÚȨ±íÖÐʹ
ÓÃ
Ö÷
»úÃûÁ˶øÖ»ÄÜÓÃip¸ñʽ¡£
ÈôʹÓÖskip-grant-tablesϵͳ½«¶ÔÈκÎÓû§µÄ·ÃÎʲ»×öÈκηÃÎÊ¿ØÖÆ£¬µ«¿ÉÒÔÓà mysqladmin
flush-privileges»òmysqladmin reloadÀ´¿ªÆô·ÃÎÊ¿ØÖÆ;ĬÈÏÇé¿öÊÇshow databasesÓï¾ä¶ÔËùÓÐÓû§¿ª·Å£¬
Èç¹ûmysql·þÎñÆ÷ûÓпªÔ¶³ÌÕÊ»§£¬¾ÍÔÚmy.cnfÀïÃæ¼ÓÉÏskip-grant-tables
Ïà¹ØÎĵµ£º
¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) select DAYOFWEEK('1998-02-03');
-&g ......
mysqlÍ£Ö¹ÃüÁî
bin/mysqladmin -uroot -p shutdown
mysqlÆô¶¯ÃüÁî
bin/mysqld_safe &
mysql ÐÞ¸ÄrootÃÜÂë
1.Í£Ö¹mysql·þÎñ
2.Æô¶¯mysql·þÎñʱ¸½¼Ó²ÎÊý
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.ÒÔroot½øÈëmysql
mysql -u root mysql
4.Ö´ÐÐsqlÓï¾ä
mysql> UPDATE user S ......
mysql
ÃüÁ½õ
²âÊÔ»·¾³£ºmysql 5.0.45
¡¾×¢£º¿ÉÒÔÔÚmysql
ÖÐͨ¹ýmysql>
SELECT VERSION();
À´²é¿´Êý¾Ý¿â°æ±¾¡¿
Ò»¡¢Á¬½ÓMYSQL
¡£
¸ñʽ£º mysql -h
Ö÷»úµØÖ· -u
̞
£p
Óû§ÃÜÂë
1
¡¢Á¬½Óµ½±¾»úÉϵÄMYSQL
¡£
Ê×ÏÈ´ò¿ªDOS
´°¿Ú£¬È»ºó½øÈëĿ¼mysql\bin
£¬ÔÙ¼üÈëÃüÁîmysql -u r ......
Ô¶³ÌµÇ¼ -h IPµØÖ·
ctrl + d Í˳ö »ò \q »ò quit
select version(); µ±Ç°°æ±¾
current_dateµ±Ç°ÈÕÆÚ »òcurdate() »ò current_date()
SELECT name, birth, curdate(),(year(curdate())-year(birth)) - (right(curdate(),5)<right(birth,5)) as age from ±í ORDER BY name;
year ÌáÈ¡Ä겿·Ö right(curdate(),5)ÌáÈ¡Ó ......
Ê×ÏÈ£ºÈ·¶¨Êý¾Ý¿âµÄ±àÂëΪutf8£¬Õý³£´¢´æÖÐÎÄ£¨ÓÃMySQL-Front²é¿´ÖÐÎÄÊÇ·ñÕý³££©
È»ºó£ºServices²éѯMySQLʱʹÓÃ"SET NAMES 'utf8'"£¬ÇÒͨ¹ý"amfphp/browser"ÔËÐп´¿´ÊÇ·ñÖÐÎÄ£¬Èç¹ûÂÒÂëÔòÐÞ¸Ägateway.phpÎļþ£¬È¥µô $gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1");
×îºó£ºÔËÐÐFlex³ÌÐòÏÔ ......