MySQL Command Line Client

來源:互聯網
上載者:User

Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 57
Server version: 6.0.4-alpha-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cars               |
| mysql              |
| phpmyadmin         |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql> create database db;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cars               |
| db                 |
| mysql              |
| phpmyadmin         |
| test               |
+--------------------+
6 rows in set (0.00 sec)

mysql> use db
Database changed
mysql> create table users ( name varchar(50),pwd varchar(20) );
Query OK, 0 rows affected (0.04 sec)

mysql> insert into users (name,pwd) values ( 'ZhangSan','123456' );
Query OK, 1 row affected (0.00 sec)

mysql> insert into users (name,pwd) values ( '李四','56789' );
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from users;
+----------+--------+
| name     | pwd    |
+----------+--------+
| ZhangSan | 123456 |
|          | 56789  |
+----------+--------+
2 rows in set (0.00 sec)

mysql> set names gbk;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into users (name,pwd) values ( '王五','abcde' );
Query OK, 1 row affected (0.00 sec)

mysql> update users set name='張三' where pwd='56789';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from users;
+----------+--------+
| name     | pwd    |
+----------+--------+
| ZhangSan | 123456 |
| 張三         | 56789  |
| 王五         | abcde  |
+----------+--------+
3 rows in set (0.00 sec)

mysql> status;
--------------
D:\AppServ\MySQL\bin\mysql.exe  Ver 14.14 Distrib 6.0.4-alpha, for Win32 (ia32)

Connection id:          57
Current database:       db
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         6.0.4-alpha-community-log MySQL Community Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    gbk
Conn.  characterset:    gbk
TCP port:               3306
Uptime:                 3 hours 1 min 42 sec

Threads: 1  Questions: 314  Slow queries: 0  Opens: 23  Flush tables: 1  Open ta
bles: 1  Queries per second avg: 0.28
--------------

mysql> show variables like '%char%';
+--------------------------+----------------------------------+
| Variable_name            | Value                            |
+--------------------------+----------------------------------+
| character_set_client     | gbk                              |
| character_set_connection | gbk                              |
| character_set_database   | utf8                             |
| character_set_filesystem | binary                           |
| character_set_results    | gbk                              |
| character_set_server     | utf8                             |
| character_set_system     | utf8                             |
| character_sets_dir       | d:\AppServ\MySQL\share\charsets\ |
+--------------------------+----------------------------------+
8 rows in set (0.00 sec)

mysql> show columns from users;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| name  | varchar(50) | YES  |     | NULL    |       |
| pwd   | varchar(20) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> _

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.