1,允许用户root以密码123456从任何主机连接到数据库
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
2,创建表
mysql> CREATE TABLE user(
-> uid INT NOT NULL AUTO_INCREMENT,
-> account VARCHAR(100) NOT NULL,
-> password VARCHAR(40) NOT NULL,
-> register_stamp DATE,
-> PRIMARY KEY ( uid )
-> );
3,导出数据库
mysqldump -u root -ppassword 数据库名 导出路径
注:密码必须紧跟-p,不能加空格
4,修改表中某一列的默认值
alter table table_name alter column column_name set default default_value;
5,修改表中某一列类型
alter table table_name modify 字段名 类型;