mysql

2014-11-12 22:02  675人阅读  评论 (0)
Tags: mysql

创建数据库

CREATE SCHEMA `blog` DEFAULT CHARACTER SET utf8 ;

引用数据库

USE `blog`;

创建表

CREATE TABLE `blog`.`users` (
  `id` INT NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` VARCHAR(16) CHARACTER SET 'ascii' NOT NULL COMMENT '密码',
  `password` VARCHAR(32) CHARACTER SET 'ascii' NOT NULL COMMENT '用户名',
  PRIMARY KEY (`id`)  COMMENT '',
  UNIQUE INDEX `username_UNIQUE` (`username` ASC)  COMMENT '')
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8
COMMENT = '用户表';

导出

mysqldump --default-character-set utf8 -S /tmp/mysql.sock -u root -p dotcoo_com > dotcoo.sql

导入

source /root/dotcoo.sql

用户管理

http://www.dotcoo.com/mysql-user