• ADADADADAD

    mysql基本命令[ mysql数据库 ]

    mysql数据库 时间:2024-12-24 19:13:15

    作者:文/会员上传

    简介:

    结尾用;号或者\gshow databases; //展示有哪些数据库use test; //use +数据库名,进入数据库show tables; //显示库里的表show tables from mysql; //show tables from +库名,查

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    结尾用;号或者\g

    show databases; //展示有哪些数据库
    use test; //use +数据库名,进入数据库
    show tables; //显示库里的表
    show tables from mysql; //show tables from +库名,查看指定库内的表,查看时并不会离开当前库,或者用前两种方式use进入后show,

    select database(); //查看当前所在哪个库
    创建表:

    create table hellowrold(//create table 后指定表名id int,//指定列名和类型还要指定其他列名时用,号分隔name varchar(20));//varchar(20); 长度为20的字符串类型

    desc hellowrold;//desc +表名显示表的框架等详细数据
    select (星号) from hellowrold;//select from +表名,查看表内数据

    insert into hello(id,name) values(1,"me");//插入数据到表头,insert into +表名(列名,列名) values(赋值,赋值);

    update hello set address="she" where id =1;//修改id=1对应的address的列的名字为
    she, updata +表名 +set+ 列名="赋值" +where+另一个列名 =另一个列名对应的值;

    delete from hello where id =1; //删除hello表中,id列值为1所在的行,delete from+
    表头+where +列名=值;

    select version();//查看当前数据库版本

    先退出mysql然后输入mysql -V//没有分号,相当于dos命令,查看数据库版本

    mysql基本命令.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: mysql