问题1:ERROR 1820 (HY000): You must SET PASSWORD before executing this statement数据库
方法:SET PASSWORD = PASSWORD('123456');this
基本操做:spa
一、 显示数据库:show databases;
二、 建数据库:create database [if not exists] 数据库名;
三、 建数据表: create table [if not exists] 表名 (字段名1 类型。。。。。。。。)
create table student (编号 int auto_increment primary key, 姓名 varchar(10));
注意:设置了自动增加,就要定为主键,若是选择了BIT 类型,0不显示,非0显示为一个特殊符号!
四、 显示数据表:show tables;
五、 删除库: drop database [if exists] 库名;
六、 删除表: drop table [if exists] 表名;
七、 显示表结构: desc 表名
八、 如何修改表结构:增加一个字段; alter table 表名 add 字段名 类型
九、 删除一个字段: alter table 表名 drop 字段名
十、 修改一个字段的属性: alter table 表名modify 字段 新属性
十一、 修改主键: 增长一个主键 alter table 表名 add primary key(字段名)
十二、 删除一个主键 alter table 表名 drop primary key(字段名)rem