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

Àû¾ÉÔ­À´°²×°µÄXAMPP£¬µ«Ê¹MySQLÖ§³ÖTransaction

 Ò»Ö±Ê¹ÓÃMysql£¬×î½ü²ÅÁ˽⵽MysqlÖ§³ÖÁËTransaction¡£ÀÏÁË£¬¸ú²»ÉÙ³±Á÷ÁË¡£
ÄǾͰÑÔ­À´µÄÓ¦ÓøijÉBased On TransactionµÄ°É¡£
½«½¨±íÓï¾ä¸Ä³ÉEngine=InnoDB£¬ºÃÏñ»¹ÊDz»ÐУ¬Ã»ÓÐÏëÏóÖÐÄÇô¼òµ¥¡£
²éÒ»²é£¬Å¶£¬·¢ÏÖXAMPP°²×°µÄMysql»¹ÒªÐÞ¸ÄconfÎļþ£º
XAMPP from Apache Friends is a collection of free open source apps that make it easy to install Apache distribution containing MySQL, PHP and Perl. There are four XAMPP distributions for Windows, Linux , Mac OS X and Solaris. To set up an Apache web server with XAMPP, simply download and extract XAMPP, and the Apache HTTPD web server is ready after one or two more auto-execute scripts. There are no changes to the Windows registry (unless you’re using Widows installer version of XAMPP) and it’s not necessary to edit any configuration files.
However, by default, InnoDB MySQL database storage engine is not enabled in the my.cnf configuration file. If a webmaster plans to use InnoDB features, such as one to many or many to many table relationships on foreign key constraints, or transaction-safe commands such as commit, rollback and crash recovery capabilities.
To enable the support of MySQL server on InnoDB storage engine, locate the “my.cnf” config file (normally in /installation_path/xampp/mysql/bin/ directory), and edit the my.cnf with any text editor such as vi.
Search and locate each of the following lines (except the lines in italic where they’re comments):
- Comment the following line to unskip and use InnoDB
skip-innodb
- Uncomment the following options for InnoDB database if you are using InnoDB tables.
#innodb_data_home_dir = C:/xampp/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:/xampp/xampp/mysql/data/
#innodb_log_arch_dir = C:/xampp/xampp/mysql/data/
- Uncomment the lines and set innodb_buffer_pool_size up to 50% – 80% of RAM for optimization of InnoDB databases, try not to memory usage too high.
#set-variable = innodb


Ïà¹ØÎĵµ£º

MYSQL LAST_INSERT_ID()

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 ......

mysqlÃüÁî´óÈ«

Æô¶¯£ºnet start mySql;
¡¡¡¡½øÈ룺mysql -u root -p/mysql -h localhost -u root -p databaseName;
¡¡¡¡ÁгöÊý¾Ý¿â£ºshow databases;
¡¡¡¡Ñ¡ÔñÊý¾Ý¿â£ºuse databaseName;
¡¡¡¡Áгö±í¸ñ£ºshow tables£»
¡¡¡¡ÏÔʾ±í¸ñÁеÄÊôÐÔ£ºshow columns from tableName£»
¡¡¡¡½¨Á¢Êý¾Ý¿â£ºsource fileName.txt;
¡¡¡¡Æ¥Åä× ......

ÈçºÎµ¼Èë.sqlÎļþµ½mysqlÖÐ

ÈçºÎµ¼Èë.sqlÎļþµ½mysqlÖУ¿
C:\mysql\bin>mysql  -u  Óû§Ãû -p  Êý¾Ý¿âÃû  <   c:/test.sql    (source "c:\adsense.sql" )
ÖмäµÄ¿Õ¸ñÊÇÒ»¸ö¿Õ¸ñλ¡£
ͬʱʹÓÃ200¶àMBµÄsqlÎļþ¡£
ÀýÈ磺
C:\Program Files\MySQL\bin>mysql -u root -p myrosz & ......

ÓÃmysqldumpslow·ÖÎömysqlµÄslow query log

mysqlÓÐÒ»¸ö¹¦ÄܾÍÊÇ¿ÉÒÔlogÏÂÀ´ÔËÐеıȽÏÂýµÄsqlÓï¾ä£¬Ä¬ÈÏÊÇûÓÐÕâ¸ölogµÄ£¬ÎªÁË¿ªÆôÕâ¸ö¹¦ÄÜ£¬
ÒªÐÞ¸Ämy.cnf»òÕßÔÚmysqlÆô¶¯µÄʱºò¼ÓÈëһЩ²ÎÊý¡£Èç¹ûÔÚmy.cnfÀïÃæÐ޸ģ¬ÐèÔö¼ÓÈçϼ¸ÐÐ
long_query_time = 1
log-slow-queries = /var/youpath/slow.log
log-queries-not-using-indexes
long_query_time ÊÇÖ¸Ö´ ......

¹ØÓÚMySQLµÄ1067´íÎó½â¾ö·½·¨

 ¡ù ¹ØÓÚMySQLµÄ1067´íÎó½â¾ö·½·¨ ¡ù
ÄÚÈÝ£º
*************
1
°²×°MYSQLºó¸ü¸ÄÁËROOTµÄÃÜÂëºóÓÃ
net startmysql
Æô¶¯Ê±ÎÒ¾ÍÓöµ½ÁËÕâÑùµÄÎÊÌ⣮ʹÓÃÒÔÏÂÃüÁîºó
c:\mysql\bin\mysqladmin-u root -p shutdown
ÔÙnet start mysql¾ÍûÓÐÕâ¸ö´íÎóÌáʾÁË!
*************
2
MySQLµÄ1067´íÎó
Q£ºÎÒµÄMysqlÅöµ½ÁË 1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ