安裝MYSQL資料庫,詳細參考:
簡而言之,就是:
1)下載下傳MySQL Yum repository
2)安裝MySQL Yum repository
yum localinstall mysql57-community-release-el6-{version-number}.noarch.rpm
3)安裝MYSQL資料庫
yum install mysql-community-server
2.支援INNODB引擎
1)修改配置檔案:/etc/my.cnf
在配置檔案中的[mysqld]字段添加 default-storage-engine=INNODB ,将預設的資料庫引擎修改為InnoDB
2)重新開機資料庫
3)建立表時,注意添加ENGINE = InnoDB;指令,如:
create table mytable
(
id int not null auto_increment,
name varchar(32) not null,
) ENGINE = InnoDB;
3.建立支援utf8字元集的資料庫
如果要支援中文等寬位元組語言,資料庫需要采用utf8字元編碼,建庫時明确指出:
CREATE DATABASE mydb DEFAULT CHARSET utf8 COLLATE utf8_general_ci