zoukankan      html  css  js  c++  java
  • cmd 下sql语句及结果

    Microsoft Windows [版本 10.0.14393]
    (c) 2016 Microsoft Corporation。保留所有权利。

    C:Users李长青>mysql -uroot -h127.0.0.1 -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 164
    Server version: 5.6.17 MySQL Community Server (GPL)

    Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

    mysql> use calls1
    Database changed
    mysql> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | calls1 |
    | mysql |
    | performance_schema |
    | test |
    +--------------------+
    5 rows in set (0.00 sec)

    mysql> use calls1
    Database changed
    mysql> select * from user;
    +----+--------+-----+-----+--------+-----+
    | id | name | pwd | sex | class1 | tel |
    +----+--------+-----+-----+--------+-----+
    | 3 | | | | | |
    | 54 | 李长青 | 123 | 男 | 应用 | 521 |
    | 53 | | | | | |
    +----+--------+-----+-----+--------+-----+
    3 rows in set (0.00 sec)

    mysql> describe user ;
    +--------+------------------+------+-----+---------+----------------+
    | Field | Type | Null | Key | Default | Extra |
    +--------+------------------+------+-----+---------+----------------+
    | id | int(11) unsigned | NO | PRI | NULL | auto_increment |
    | name | varchar(50) | NO | | NULL | |
    | pwd | varchar(50) | NO | | NULL | |
    | sex | varchar(10) | NO | | NULL | |
    | class1 | varchar(50) | NO | | NULL | |
    | tel | varchar(50) | NO | | NULL | |
    +--------+------------------+------+-----+---------+----------------+
    6 rows in set (0.00 sec)

    mysql> delete from user where id"3";
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"3"' at line 1
    mysql> delete from user where id='3';
    Query OK, 1 row affected (0.00 sec)

    mysql> use calls1
    Database changed
    mysql> create table user001(
    -> id int auto_increment primary key,
    -> user varchar(50) not null,
    -> pwd varchar(50) not null,
    -> createtime datetime);
    Query OK, 0 rows affected (0.27 sec)

    mysql> use user001
    ERROR 1049 (42000): Unknown database 'user001'
    mysql> describe user001;
    +------------+-------------+------+-----+---------+----------------+
    | Field | Type | Null | Key | Default | Extra |
    +------------+-------------+------+-----+---------+----------------+
    | id | int(11) | NO | PRI | NULL | auto_increment |
    | user | varchar(50) | NO | | NULL | |
    | pwd | varchar(50) | NO | | NULL | |
    | createtime | datetime | YES | | NULL | |
    +------------+-------------+------+-----+---------+----------------+
    4 rows in set (0.00 sec)

    mysql>

  • 相关阅读:
    hadoop 2.5 hdfs namenode –format 出错Usage: java NameNode [-backup] |
    自己动手编译hadoop-2.5.2源码
    CentOS Linux解决Device eth0 does not seem to be present
    Liz Murray成功故事的偶然与必然(转)
    【BZOJ4242】水壶(克鲁斯卡尔重构树,BFS)
    【BZOJ3551】Peaks加强版(Kruskal重构树,主席树)
    【agc023E】Inversions(线段树,动态规划)
    【CF183D】T-shirt(动态规划,贪心)
    【BZOJ2423】最长公共子序列(动态规划)
    【BZOJ2118】墨墨的等式(最短路)
  • 原文地址:https://www.cnblogs.com/lichangqing1997/p/7928207.html
Copyright © 2011-2022 走看看