zoukankan      html  css  js  c++  java
  • mySQL

    SQL数据库的一些简单操作

    > 运行cmd进入DOS命令界面,假设我们的用户名为root,密码为admin

    > 登陆SQL数据库。sql -uroot -admin

    > show databases;显示全部的数据库,这里记得在语句后面用分号来表示一句话的结束

    > create database if not exists dbname default charset utf8;当不存在叫dbname名字的数据库时,创建它并将默认编码格式换位utf8
    > drop database dbname;删除叫dbname的数据库
    > use dbname;修改dbname数据库
    > create table table(id int);
    > 修改表alter table student add address varchar(20);
    > create table test select * from student where 1=0;仅复制表结构
    > create index myIndex on student(id);将id设置为索引myIndex

  • 相关阅读:
    Go
    Go
    Go
    Go
    Go
    Go
    爬虫常用相关库
    Go
    python基础第7天(day19)
    python基础第五天(day17)元组,集合,字符串操作 字符编码:
  • 原文地址:https://www.cnblogs.com/quanby/p/5445030.html
Copyright © 2011-2022 走看看