贝贝爸爸的程序人生

关注Seam、BPM
posts - 23, comments - 10, trackbacks - 0, articles - 32
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Mysql常用命令

Posted on 2011-05-26 21:36 贝贝爸爸 阅读(218) 评论(0)  编辑  收藏
1、显示数据库列表。
show databases;
2、显示库中的数据表:
use mysql;
show tables;
3、显示数据表的结构:
describe 表名;
4、建库:
create database 库名;
5、建表:
use 库名;
create table 表名 (字段设定列表);
6、删库和删表:
drop database 库名;
drop table 表名;
7、将表中记录清空:
delete from 表名;
8、显示表中的记录:
select * from 表名

  • 外网无法访问的问题
    #登录myql
    #
    mysql -u root mysql -p

    #mysql>update user set password=password('123456') where user='root';

    #mysql>fulsh privileges;
    #
    mysql>\q

只有注册用户登录后才能发表评论。


网站导航: