zoukankan      html  css  js  c++  java
  • mysql 操作sql语句 操作数据库

    sql语句

    #1. 操作文件夹
            创建数据库:create database db1 charset utf8;
            查数据库:show databases;

    mysql> create database db1 charset utf8;
    Query OK, 1 row affected (1.50 sec)
    
    mysql> 
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | db1                |
    | mysql              |
    | test               |
    +--------------------+
    4 rows in set (0.01 sec)

    查看刚才创建的数据库信息   字符编码

    
    
    mysql> show create database db1;
    +----------+--------------------------------------------------------------+
    | Database | Create Database                                              |
    +----------+--------------------------------------------------------------+
    | db1      | CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */ |
    +----------+--------------------------------------------------------------+
    1 row in set (0.03 sec)
    
    

      改字符编码 改哪个数据库 改:alter database db1 charset gbk;

    mysql> show create database db1 ;
    +----------+-------------------------------------------------------------+
    | Database | Create Database                                             |
    +----------+-------------------------------------------------------------+
    | db1      | CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET gbk */ |
    +----------+-------------------------------------------------------------+
    1 row in set (0.00 sec)
    
    
    


         删除数据库: drop database db1;


     
  • 相关阅读:
    HMS11.Image, TabList与Tab, Picker
    HMS10. JavaUI框架, Text, Button,TextField
    HMS09.Ability
    HMS08. 快速入门
    HMS07.应用的运行、DeBug、HiLog、HiTrace
    批量插入100万条数据
    关于ios7 UINavigationController.interactivePopGestureRecognizer手势集成
    iOS 常用框架介绍
    iOS 内存管理(转载)
    cocoapod 最新安装使用步骤
  • 原文地址:https://www.cnblogs.com/mingerlcm/p/9745693.html
Copyright © 2011-2022 走看看