Command Line Client(建库,建表)
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.55-community MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database test_1
->
->
-> alter database test_1
->
->
->
->
-> default character set gbk
-> default collate gbk_chinese_ci;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'alter database test_1
default character set gbk
default collate gbk_chinese_' at line 4
mysql> create database test_1;
Query OK, 1 row affected (0.01 sec)
mysql> alter database test_1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> alter database test_1
-> default character set gbk
-> default collate gbk_chinese_ci;
Query OK, 1 row affected (0.00 sec)
mysql> use test_1;
Database changed
mysql> create table students
-> <
-> stu_id int not null auto_increment,
-> stu_name char(50) not null,
-> stu_sex char(1) not null default 'F',
-> primary key(stu_id)
-> >engine=InnoDB;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<
stu_id int not null auto_increment,
stu_name char(50) not null,
stu_sex char(1' at line 2
mysql> create table students
-> (
-> stu_id int not null auto_increment,
-> stu_name char(50) not null,
-> stu_sex char(1) not null default 'F',
-> primary key(stu_id)
-> )engine=InnoDB;
Query OK, 0 rows affected (0.01 sec)
命令以“;”结束,或者如提示Commands end with ; or \g.
帮助:Type 'help;' or '\h' for help.
清空: Type '\c' to clear the current input statement.
建库:create database test_1;
建表:create table students
-> (
-> stu_id int not null auto_increment,
-> stu_name char(50) not null,
-> stu_sex char(1) not null default 'F',
-> primary key(stu_id)
-> )engine=InnoDB;
Command Line Client(建库,建表)的更多相关文章
- MySQL建库建表
一直使用SQL SERVER 数据库:最近项目使用MY SQL感觉还是有一点不适应.不过熟悉之后就会好很多. MY SQL 安装之后会有一个管理工具MySQL Workbench 感觉不太好用,数据库 ...
- 【ITOO 2】.NET 动态建库建表:使用SQL字符串拼接方式
导读:在最近接手的项目(高效云平台)中,有一个需求是要当企业用户注册时,给其动态的新建一个库和表.刚开始接手的时候,是一点头绪都没有,然后查了一些资料,也问了问上一版本的师哥师姐,终于有了点头绪.目前 ...
- 【ITOO 3】.NET 动态建库建表:实用EF框架提供的codeFirst实现动态建库
导读:在上篇博客中,介绍了使用SQL字符拼接的方式,实现动态建库建表的方法.这样做虽然也能够实现效果,但是,太麻烦,而且,如果改动表结构,字段的话,会对代码修改很多.但是EF给我们提供了一种代码先行的 ...
- SQL Server建库-建表-建约束
----------------------------------------SQL Server建库-建表-建约束创建School数据库------------------------------ ...
- 使用T-sql建库建表建约束
为什么要使用sql语句建库建表? 现在假设这样一个场景,公司的项目经过测试没问题后需要在客户的实际环境中进行演示,那就需要对数据进行移植,现在问题来了:客户的数据库版本和公司开发阶段使用的数据库不兼容 ...
- mysql那些事(4)建库建表编码的选择
mysql建数据库或者建表的时候会遇到选择编码的问题,以前我们都是习惯性的选择utf8,但是在mysql在5.5.3版本后加了utf8mb4的编码,utf8mb4可以存4个字节Unicode,mb4就 ...
- C# 利用*.SQL文件自动建库建表等的类
/// <summary> /// 自动建库建表 /// </summary> public class OperationSqlFile { SqlConnection sq ...
- MySql command line client 命令系列
—————————————————————————————————————————————————————————— 一.启动与退出 1.进入MySQL:启动MySQL Command Line Cl ...
- MySQL在command line Client下的一些命令
MySQL在command line Client下的一些命令 通过CMD进入到本地数据库: mysql -h localhost -u -root -p 参数说明: -h 要连接的服务器的主机名或I ...
- Can't use Subversion command line client: svn Probably the path to Subversion executable is wrong. Fix it.
1.最近使用SVN工具时,Checkout出项目到本地后后,然后将其导入到Intellij idea中开发,在提交svn代码的时候,出现这样的错误:Can't use Subversion comma ...
随机推荐
- CSS概念 - 可视化格式模型(一) 盒模型与外边距叠加
可以参考<精通CSS 高级WEB标准解决方案>第三章. 可视化格式模型 可视化格式模型要掌握的3个最重要的CSS概念是 浮动.定位.盒模型. 这些概念控制在页面上安排和显示元素的方式, 形 ...
- jquery事件之事件处理函数
一.事件处理 方法名 说明 语法 (events 事件类型,data数据,handler 事件处理函数,selector 选择器) Bind( 为每一个匹配元素的特定事件(像click)绑定一个事件处 ...
- 【leetcode 3. 无重复字符的最长子串】解题报告
思路:滑动窗口的思想 方法一:滑动窗口 int lengthOfLongestSubstring(string s) { /* 控制一个滑动窗口,窗口内的字符都是不重复的,通过set可以做到判断字符是 ...
- 开发php接口注意点
1.制定规范 开发前一定要定好一个规范,比如要定好数据返回的通用参数和格式.关于数据格式,用的比较多的有xml和json,我建议用json,因为json比xml的好处更多. 2.精简的返回数据 接口数 ...
- Mybatis学习笔记之一——牛刀小试
1.Mybaits核心对象SqlSession的作用: (1)向SQL语句传入参数: (2)执行SQl语句: (3)获取执行SQL语句的结果: (4)事务的控制: 2.核心配置文件(Configrat ...
- 基于Canvas 实现图片转点阵图
要实现什么 同事想做一张世界地图的背景图,但是网上找的图片都太low了.他想用那种密集的点阵组成的世界地图.作为程序员,想法当然是通过图片处理,识别像素点,然后生成新的图片. 目标是这样的: 实现思路 ...
- [Xcode 实际操作]三、视图控制器-(5)使用UINavigationController视图入栈和出栈
目录:[Swift]Xcode实际操作 本文将演示使用导航控制器的几个跳转方式 选择编辑第二个视图控制器文件 import UIKit //定义一个全局变量,用来记录当前显示区域的视图的编号 clas ...
- windows系统下python2.7.14版本的安装
[前言] 本文主要对window下如何安装Python进行图解说明. [正文] 步骤一 从官网下载相应的版本(本文以2.7.14为例),下载地址:https://www.python.org/down ...
- Linux 调优方案, 修改最大连接数(ulimit命令)
https://blog.csdn.net/isoleo/article/details/51732687 https://www.cnblogs.com/zengkefu/p/5649407.htm ...
- Mediator模式(仲裁者设计模式)
Mediator ? Mediator的意思是"仲裁者""中介者".一方面,当发生麻烦事情的时候,通知仲裁者:当发生涉及全体组员的事情时,也通知仲裁者.当仲裁者 ...