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


相关文档:

利旧原来安装的XAMPP,但使MySQL支持Transaction

 一直使用Mysql,最近才了解到Mysql支持了Transaction。老了,跟不少潮流了。
那就把原来的应用改成Based On Transaction的吧。
将建表语句改成Engine=InnoDB,好像还是不行,没有想象中那么简单。
查一查,哦,发现XAMPP安装的Mysql还要修改conf文件:
XAMPP from Apache Friends is a collection of free open s ......

MySQL 5.0.16 乱码问题处理办法


1 设置phpMyAdmin
Language:Chinese simplified (zh-utf-8)
MySQL 字符集:UTF-8 Unicode (utf8)
MySQL 连接校对 gbk_chinese_ci
2 创建数据库时
整理设置成 gbk_chinese_ci
3 用SQL建立表中
ENGINE=MyISAM DEFAULT CHARSET=gbk;
ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=40 ;
4 检查表结构中
varcha ......

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中文乱码问题解决方案

    在之前的文章里,我已经提过如何解决JSP中乱码问题(解决tomcat下中文乱码问题 ),其中也详细解说了MYSQL乱码问题,相信通过里面的办法,肯定都已经解决了JSP里的乱码问题,不过还是有些人的MYSQL乱码问题没有得到解决,包括我自己,所以又找了一些资料,希望这次能完全解决MYSQL数据库的乱码问题。
......

两种转换mysql数据编码的方法

背景:某个系统的mysql数据库dnname采用默认的latin1字符集,系统升级需要将所有数据转换成utf-8格式,目标数据库为newdbname(建库时使用utf8)
方法一:
步骤一 命令行执行:mysqldump --opt -hlocalhost -uroot -p*** --default-character-set=lantin1 dbname > /usr/local/dbname.sql
步骤二 将 dbname.s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号