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

11 advanced MySQL questions

 

Explain MySQL architecture
. - The front layer
takes care of network connections and security authentications, the
middle layer does the SQL query parsing, and then the query is handled
off to the storage engine. A storage engine could be either a default
one supplied with MySQL (MyISAM) or a commercial one supplied by a
third-party vendor (ScaleDB, InnoDB, etc.)
Explain MySQL locks
. - Table-level locks allow the
user to lock the entire table, page-level locks allow locking of
certain portions of the tables (those portions are referred to as
tables), row-level locks are the most granular and allow locking of
specific rows.
Explain multi-version concurrency control in MySQL
.
- Each row has two additional columns associated with it - creation
time and deletion time, but instead of storing timestamps, MySQL stores
version numbers.
What are MySQL transactions?
- A set of instructions/queries that should be executed or rolled back as a single atomic unit.
What’s ACID?
- Automicity - transactions are
atomic and should be treated as one in case of rollback. Consistency -
the database should be in consistent state between multiple states in
transaction. Isolation - no other queries can access the data modified
by a running transaction. Durability - system crashes should not lose
the data.
Which storage engines support transactions in MySQL?
- Berkeley DB and InnoDB.
How do you convert to a different table type?
- ALTER TABLE customers TYPE = InnoDB
How do you index just the first four bytes of the column?
- ALTER TABLE customers ADD INDEX (business_name(4))
What’s the difference between PRIMARY KEY and UNIQUE in MyISAM?
- PRIMARY KEY cannot be null, so essentially PRIMARY KEY is equivalent to UNIQUE NOT NULL.
How do you prevent MySQL from caching a query?
- SELECT SQL_NO_CACHE …
What’s the difference between query_cache_type 1 and 2?
- The second one is on-demand and can b


Ïà¹ØÎĵµ£º

C# mysql¶ÁÈ¡Àà

 using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySql.Data.Types;
using MySql.Data.MySqlCl ......

¹ØÓÚ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 ......

Àû¾ÉÔ­À´°²×°µÄ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 s ......

fedora12Ï°²×°apache+php+mysql(LAMP)+phpmyadmin

1 °²×°MySQL5
ÓÃÏÂÁÐÃüÁî°²×°MySQL£º
yum install mysql mysql-server
È»ºóÎÒÃÇΪMySQL´´½¨ÏµÍ³Æô¶¯Á´½Ó£¨ÕâÑùµÄ»°£¬MySQL¾Í»áËæ×ÅϵͳÆô¶¯¶øÆô¶¯£©£¬²¢Æô¶¯MySQL·þÎñÆ÷£º
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
ÔËÐÐ
mysqladmin -u root password yourrootsqlpassword
À´ÎªrootÓû§ÉèÖà ......

mysqlÐÔÄܵļì²éºÍµ÷ÓÅ·½·¨

À´Ô´£ºhttp://www.sudone.com/linux/mysql_debug.html
×÷ÕߣºAyou
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ