mysql ÕÒ»ØÃÜÂë
1. Í£µ½ÔËÐеÄmysql: /etc/init.d/mysql stop
2. ʹÓÃskip-grant-tablesÕâ¸öÑ¡ÏîÆô¶¯MySQL£º /usr/bin/mysqld_safe --skip-grant-tables &
3. ÏÖÔÚ¿ÉÒÔ²»ÓÃÃÜÂë½øÈëmysql ÁË¡£
# myql
> use mysql;
> UPDATE user SET password=password('123456') WHERE user='root'; //ÃÜÂëÐÞ¸ÄΪ123456;
> FLUSH PRIVILEGES;
> quit;//Í˳ömysql
4. ÖØÆômysql : /etc/init.d/mysql restart
ÏÖÔھͿÉÒÔÓÃmysql -uroot -p123456µÇ½ÁË¡£
ת×Ôhttp://blog.csdn.net/ytz_linuxer/archive/2009/07/03/4320660.aspx
Ïà¹ØÎĵµ£º
ÕâÁ½ÌìÎÒ×°ÁËUBUNTU £¬ÔÚ±àÒë°²×°MYSQLµÄʱºòûÓгöʲôÎÊÌ⣬
µ½scripts/mysql_install_db --user=mysql
ÕâÒ»²½Ê±£¬µÃµ½ÈçÏ´íÎó
FATAL ERROR: Can't find mysqld. Please specify your installation
directory with the '--basedir=' option.
FATAL ERROR: Could not find SQL file '/fill_help_tables.sql'
µ½ÍøÉ ......
MySQL·þÎñÆ÷°üº¬Ò»Ð©ÆäËûSQL DBMSÖв»¾ß±¸µÄÀ©Õ¹¡£×¢Ò⣬Èç¹ûʹÓÃÁËËüÃÇ£¬½«ÎÞ·¨°Ñ´úÂëÒÆÖ²µ½ÆäËûSQL·þÎñÆ÷¡£ÔÚijЩÇé¿öÏ£¬Äã¿ÉÒÔ±àд°üº¬MySQLÀ©Õ¹µÄ´úÂ룬µ«ÈÔ±£³ÖÆä¿ÉÒÆÖ²ÐÔ£¬·½·¨ÊÇÓÓ/*... */”×¢Ê͵ôÕâЩÀ©Õ¹¡£MySQL·þÎñÆ÷Äܹ»½âÎö²¢Ö´ÐÐ×¢ÊÍÖеĴúÂ룬¾ÍÏñ¶Ô´ýÆäËûMySQLÓï¾äÒ»Ñù£¬µ«ÆäËûSQL·þÎñÆ÷½«ºöÂÔ ......
´¥·¢³ÌÐòÊÇÓë±íÓйصÄÃüÃûÊý¾Ý¿â¶ÔÏ󣬵±±íÉϳöÏÖÌض¨Ê¼þʱ£¬½«¼¤»î¸Ã¶ÔÏó¡£ÔÚijЩ´¥·¢³ÌÐòµÄÓ÷¨ÖУ¬¿ÉÓÃÓÚ¼ì²é²åÈëµ½±íÖеÄÖµ£¬»ò¶Ô¸üÐÂÉæ¼°µÄÖµ½øÐмÆËã¡£
´¥·¢³ÌÐòÓë±íÏà¹Ø£¬µ±¶Ô±íÖ´ÐÐINSERT¡¢DELETE»òUPDATEÓï¾äʱ£¬½«¼¤»î´¥·¢³ÌÐò¡£¿ÉÒÔ½«´¥·¢³ÌÐòÉèÖÃΪÔÚÖ´ÐÐÓï¾ä֮ǰ»òÖ®ºó¼¤»î¡£ÀýÈ磬¿ÉÒÔÔÚ´Ó±íÖÐɾ³ýÿһÐÐÖ® ......
CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
VIEW view_name [(column_list)]
AS select_statement
[WITH [CASCADED | LOCAL] CHECK OPTION]
¸ÃÓï¾äÄÜ´´½¨ÐµÄÊÓͼ£¬Èç¹û¸ø¶¨ÁËOR REPLACE×Ӿ䣬¸ÃÓï¾ä»¹ÄÜÌæ»»ÒÑÓеÄÊÓͼ¡£select_st ......
LAST_INSERT_ID
×Ô¶¯·µ»Ø×îºóÒ»¸ö INSERT »ò UPDATE ²Ù×÷Ϊ AUTO_INCREMENT ÁÐÉèÖõĵÚÒ»¸ö·¢ÉúµÄÖµ. ²Î¿¼ÕâÀï
The ID that was generated is maintained in the server on a per-connection basis.
LAST_INSERT_IDÊÇ»ùÓÚµ¥¸öconnectionµÄ, ²»¿ÉÄܱ»ÆäËüµÄ¿Í»§¶ËÁ¬½Ó¸Ä±ä¡£
¿ÉÒÔÓà SELECT LAST_INSERT_ID(); ²éѯLAST ......