MYSQL基础知识 MYSQL数据库基础命令
|
源代码网整理以下Mysql数据库常用命令: 源代码网整理以下启动Mysql数据库 源代码网整理以下C:>cd Mysql5.0in 源代码网整理以下C:Mysql5.0in>mysqld –install 安装Mysql服务 源代码网整理以下C:Mysql5.0in>net start mysql 启动Mysql服务 源代码网整理以下请求的服务已经启动。 源代码网整理以下连接mysql 源代码网整理以下用户须要提供Mysql的用户名和密码来连接服务器,要是服务器不是在本机,则还须要一个主机名或IP来指定服务器的位子。 源代码网整理以下C:Mysql5.0in>mysql -h localhost -u root -p 源代码网整理以下Enter passWord: **** 源代码网整理以下Welcome to the MySQL monitor. Commands end with ; or g. 源代码网整理以下Your MySQL connection id is 6 to server version: 5.0.18-nt 源代码网整理以下Type "help;" or "h" for help. Type "c" to clear the buffer. 源代码网整理以下mysql> 源代码网整理以下使用一条简单的查询语句 源代码网整理以下mysql> select version(),current_date; 源代码网整理以下mysql> select version();select now(); 源代码网整理以下新建或删除一个数据库 源代码网整理以下Mysql>create database mydb; 源代码网整理以下Mysql> drop database mydb; 源代码网整理以下打开的数据库的命令 源代码网整理以下mysql> use mysql 源代码网整理以下Database changed 源代码网整理以下察看数据库的命令 源代码网整理以下mysql> show databases; 源代码网整理以下查看数据表的详尽结构 源代码网整理以下mysql> desc func; 源代码网整理以下新建数据库 源代码网整理以下mysql> create database school; 源代码网整理以下Query OK, 1 row affected (0.00 sec) 源代码网整理以下新建表 源代码网整理以下mysql> create table user01( 源代码网整理以下-> id varchar(20) NOT NULL, 源代码网整理以下源代码网供稿. |
