日期:2014-05-16  浏览次数:20827 次

MYSQL 入门操作学习指南(建库,建表 增删改查 、表结构修改、函数、字符集校对等)

MYSQL 数据库的操作二

登录数据库

C:\Documents and Settings\Administrator>mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.5.20 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2011, 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 |

| mrzhou             |

| mysql              |

| performance_schema |

| test               |

| tt                 |

+--------------------+

6 rows in set (0.05 sec)

创建数据库并且指定指定字符集

mysql> create database mysql_mr default character set utf8;

Query OK, 1 row affected (0.01 sec)

 

mysql> show databases;

+--------------------+

| Database           |

+-------------------