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


相关文档:

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

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用户设置 ......

将Excel数据导入MySql

将Excel数据导入MySql
 
1.将选中的数据快儿拷贝到一个TXT文本文件中(记得把后面的空格消掉。。),假如存到“D:\data.txt”这个位置里。
2.根据要导入的数据快儿建立MySql数据库和表,然后进入命令提示符里使用命令
load data local infile 'D:\data.txt' into table exceltomysql fields terminated ......

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

背景:某个系统的mysql数据库dnname采用默认的latin1字符集,系统升级需要将所有数据转换成utf-8格式,目标数据库为newdbname(建库时使用utf8)
方法一:
步骤一 命令行执行:mysqldump --opt -hlocalhost -uroot -p*** --default-character-set=lantin1 dbname > /usr/local/dbname.sql
步骤二 将 dbname.s ......

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 fileNa ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号