MySQL备忘录

来源:互联网 发布:linux中rpm文件 编辑:程序博客网 时间:2024/06/06 07:08
  1. 进入mysql
    mysql -u root -p
  2. 更改默认编码方式为UTF-8
    http://blog.csdn.net/red4711/article/details/6007248
  3. 备份和还原
    http://blog.csdn.net/quietprofound/article/details/2947197
  4. 常见指令
show databases; --显示当前数据库create database mybuaa; --新建数据库use mybuaa; --使用数据库--创建数据表drop table if exists entries;create table entries (  id integer primary key auto_increment,  amount integer not null,  description text not null,  money integer not null,  people text not null,  exedate date not null);insert into entries values(1,-255,'水费',-140,'孟德超',CURDATE());--增delete from entries where id = 1;   --删update entries set people = "孟德超" where id = 1;--改select people,exedate from entries where id = 1;--查drop table entries; --删除表单drop mybuaa; --删除数据库
  1. 其他
    数据类型:http://www.runoob.com/mysql/mysql-data-types.html
    外键:http://www.cppblog.com/wolf/articles/69089.html
0 0
原创粉丝点击