zoukankan      html  css  js  c++  java
  • mysql基本命令

    1、  查看库列表

    mysql> show databases;

    +--------------------+

    | Database           |

    +--------------------+

    | information_schema |

    | mysql              |

    | performance_schema |

    | test               |

    | wordpress          |

    +--------------------+

    5 rows in set (0.00 sec)

    mysql库是MYSQL的系统信息,包含账号信息

    2、  查看库中的表

    mysql> use wordpress;   #切换到wordpress库

    Database changed

    mysql> show tables;     #显示该库中的所有表信息

    +--------------------------+

    | Tables_in_wordpress      |

    +--------------------------+

    | wp_commentmeta           |

    | wp_comments              |

    | wp_huge_itslider_images  |

    | wp_huge_itslider_params  |

    | wp_huge_itslider_sliders |

    | wp_links                 |   

    +--------------------------+

    17 rows in set (0.00 sec)

    3、  显示表的结构

    use 库名;

    desc 表名;

    4、  建库:
       create database 库名;

    5、  建表:
       use 库名;
       create table 表名(字段设定列表);

    6、  删库和删表:
       drop database 库名;
       drop table 表名;

    7、  将表中记录清空:
       delete from 表名;

    8、  显示表中的记录:
       select * from 表名;

  • 相关阅读:
    理解jquery的$.extend()、$.fn和$.fn.extend()
    前端跨域请求原理及实践
    [leetcode]Minimum Path Sum
    [leetcode]Jump Game II
    [leetcode]Merge Intervals
    [leetcode]Length of Last Word
    [leetcode]Unique Paths
    [leetcode]Text Justification
    [leetcode]Binary Tree Level Order Traversal
    [leetcode]Jump Game
  • 原文地址:https://www.cnblogs.com/wnfindbug/p/4836198.html
Copyright © 2011-2022 走看看