易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

hibernate mysql映射类型

 
integer 或者 int
int 或者 java.lang.Integer
INTEGER
4 字节
long
long  Long
BIGINT
8 字节
short
short  Short
SMALLINT
2 字节
byte
byte  Byte
TINYINT
1 字节
float
float  Float
FLOAT
4 字节
double
double  Double
DOUBLE
8 字节
b ......

MYSQL的一些小记

下午看了一段PHP100的视频。
也算有点收获。
里面的一段自写的findall的SQL函数:
public function findall($table) {
$this->query("SELECT * from $table");
}

原来只是这么简单,刚还在思考。
使用了TAB键上面的顿号来修饰MYSQL里的字段名,如:
UPDATE tablename SET `fieldname`='values' wh ......

mysql命令_基础

显示mysql基本信息:mysql>status;
查看变量:show variables like '%version%';
备份与还原命令:在最后还有
1.备份MySQL数据库的命令:
在cmd中进入到mysql的lib目录下执行如下:
mysqldump -hhostname -uusername -ppassword databaseName > backupfile.sql
例:mysqldump -hlocalhost -uroot -p123456 test ......

mysql常用命令

 
1、mysql数据库有两种驱动:
MySQL Connector/J Driver、MMMysql driver。
2、导入导出数据库命令:(bin目录下)
导出:mysqldump -u root -p bokele   >c:/mysql.sql   --default-character-set=gbk  
导入:C:\mysql\bin\> mysql -u root -p
说明:C:\mysql\bin\表示进入mysql程序 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号