Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Windows\system32>net stop mysql0815
MySQL0815 服务正在停止.
MySQL0815 服务已成功停止。
C:\Windows\system32>net start mysql0815
MySQL0815 服务正在启动 .
MySQL0815 服务已经启动成功。
C:\Windows\system32>mysql -h localhost -P 3306 -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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> exit
Bye
C:\Windows\system32>mysql -h localhost -P 3306 -u root -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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> exit
Bye
C:\Windows\system32>mysql -u root -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> show tables from mysql;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
24 rows in set (0.00 sec)
mysql> select database();
+------------+
| database() |
+------------+
| test |
+------------+
1 row in set (0.00 sec)
mysql> create table stuinfo(
-> id int,
-> name varchar(20));
Query OK, 0 rows affected (0.01 sec)
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| stuinfo |
+----------------+
1 row in set (0.00 sec)
mysql> desc stuinfo;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> select * from stuinfo;
Empty set (0.00 sec)
mysql> insert into stuinfo (id,name) values(1,'john');
Query OK, 1 row affected (0.00 sec)
mysql> insert into stuinfo (id,name) values(2,'rose');
Query OK, 1 row affected (0.00 sec)
mysql> select * from stuinfo;
+------+------+
| id | name |
+------+------+
| 1 | john |
| 2 | rose |
+------+------+
2 rows in set (0.00 sec)
mysql> update stuinfo set name='lilei' where id=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from stuinfo;
+------+-------+
| id | name |
+------+-------+
| 1 | lilei |
| 2 | rose |
+------+-------+
2 rows in set (0.00 sec)
mysql> delete from stuinfo where id=1;
Query OK, 1 row affected (0.00 sec)
mysql> select * from stuinfo;
+------+------+
| id | name |
+------+------+
| 2 | rose |
+------+------+
1 row in set (0.00 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.15 |
+-----------+
1 row in set (0.00 sec)
mysql> exit
Bye
C:\Windows\system32>mysql --version
mysql Ver 14.14 Distrib 5.5.15, for Win32 (x86)
C:\Windows\system32>mysql -V
mysql Ver 14.14 Distrib 5.5.15, for Win32 (x86)
C:\Windows\system32>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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> show DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> SHOW DATABASES\g
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use test;
Database changed
mysql> select * from stuinfo;
+------+------+
| id | name |
+------+------+
| 2 | rose |
+------+------+
1 row in set (0.00 sec)
mysql> select *
-> from stuinfo;
+------+------+
| id | name |
+------+------+
| 2 | rose |
+------+------+
1 row in set (0.00 sec)
mysql> SELECT
-> *
-> FROM
-> stuinfo;
+------+------+
| id | name |
+------+------+
| 2 | rose |
+------+------+
1 row in set (0.00 sec)
mysql> select * from stuinfo;
+------+------+
| id | name |
+------+------+
| 2 | rose |
+------+------+
1 row in set (0.00 sec)
mysql> #select * from stuinfo;
mysql>
没有合适的资源?快使用搜索试试~ 我知道了~
sql方面的代码,可以学习一下
共39个文件
sql:38个
txt:1个
需积分: 5 0 下载量 84 浏览量
2022-06-16
02:29:33
上传
评论
收藏 51KB ZIP 举报
温馨提示
sql加深版sql学习代码
资源详情
资源评论
资源推荐
收起资源包目录
代码.zip (39个子文件)
代码
day2
【案例讲解】单行函数.sql 1KB
分组函数.sql 2KB
连接查询.sql 4KB
【案例讲解】分组查询.sql 922B
分组查询.sql 3KB
【案例讲解】排序查询.sql 623B
【练习讲解】分组函数.sql 648B
常见函数.sql 6KB
排序查询.sql 1KB
day4
库和表的管理.sql 2KB
【作业讲解】查询.sql 2KB
【案例讲解】数据的增删改.sql 2KB
数据的增删改.sql 5KB
【案例讲解】库和表的管理.sql 1KB
联合查询.sql 1010B
数据类型.sql 4KB
子查询经典案例.sql 4KB
day5
标识列.sql 860B
【案例讲解】常见约束.sql 765B
常见约束.sql 5KB
事务.sql 3KB
视图.sql 4KB
【案例讲解】视图.sql 571B
day3
【作业讲解】连接查询.sql 2KB
【案例讲解】外连接.sql 728B
sql99语法的连接查询.sql 5KB
分页查询.sql 1KB
【案例讲解】子查询.sql 3KB
子查询.sql 7KB
day6
变量.sql 3KB
【案例讲解】存储过程.sql 2KB
函数.sql 2KB
存储过程.sql 4KB
流程控制结构.sql 4KB
流程控制经典案例讲解.sql 882B
day1
【案例讲解】基础查询.sql 921B
条件查询.sql 4KB
常见命令.txt 7KB
基础查询.sql 2KB
共 39 条
- 1
m0_71984937
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0