MySQL command line Client

Source: Internet
Author: User
Tags mysql command line

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 ('hangsan', '123 ');
Query OK, 1 row affected (0.00 Sec)

Mysql> insert into users (name, PWD) values ('lily', '123 ');
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 ('wang wu', 'abcde ');
Query OK, 1 row affected (0.00 Sec)

Mysql> Update users set name = 'zhang san' where Pwd = '2013 ';
Query OK, 1 row affected (0.00 Sec)
Rows matched: 1 changed: 1 Warnings: 0

Mysql> select * from users;
+ ---------- + -------- +
| Name | PWD |
+ ---------- + -------- +
| Zhangsan | 123456 |
| James | 56789 |
| Wang Wu | 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> _

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.