zoukankan      html  css  js  c++  java
  • 常用MySQL命令


    启动:net start mySql;
    进入:mysql -u root -p/mysql -h localhost -u root -p databaseName;
    列出数据库:show databases;
    选择数据库:use databaseName;
    列出表格:show tables;
    显示表格列的属性:show columns from tableName;
    建立数据库:source fileName.txt;
    匹配字符:可以用通配符_代表任何一个字符,%代表任何字符串;
    增加一个字段:alter table tabelName add column fieldName dateType;
    增加多个字段:alter table tabelName add column fieldName1 dateType,add columns fieldName2 dateType;
    多行命令输入:注意不能将单词断开;当插入或更改数据时,不能将字段的字符串展开到多行里,否则硬回车将被储存到数据中;
    增加一个管理员帐户:grant all on *.* to user@localhost identified by “password”;
    每条语句输入完毕后要在末尾填加分号’;',或者填加’\g’也可以;
    查询时间:select now();
    查询当前用户:select user();
    查询数据库版本:select version();
    查询当前使用的数据库:select database();

  • 相关阅读:
    NOIP2020 游记
    李超线段树
    选举「elections」
    Alt+数字输入
    素数
    CSP-S2020 爆炸记
    [CF487C] Prefix Product Sequence
    [CF489E] Hiking
    L2-019 悄悄关注 (25 分)
    L2-032 彩虹瓶 (25 分)
  • 原文地址:https://www.cnblogs.com/zcy_soft/p/2355481.html
Copyright © 2011-2022 走看看