@@ -88,7 +88,7 @@ static FscryptAction FscryptInferAction(const std::string& dir)
// Special case various directories that must not be encrypted,
    // often because their subdirectories must be encrypted.
    // This isn't a nice way to do this, see b/26641735
    std::vector<std::string> directories_to_exclude = {
            "lost+found", "system_ce", "system_de", "misc_ce",     "misc_de",
            "vendor_ce",  "vendor_de", "media",     "data",        "user",
-			"user_de",    "apex",      "preloads",  "app-staging", "gsi",
+            "user_de",    "apex",      "preloads",  "app-staging", "gsi", "app",
    };
    for (const auto& d : directories_to_exclude) {
        if ((prefix + d) == dir) {
            return FscryptAction::kNone;
        }
    }
@echo off
echo .>%windir%\test.txt
if exist %windir%\test.txt (
del /f /q /a %windir%\test.txt>nul 2>nul
) else (
cls
echo.
echo.
echo    没有权限无法运行,请右键“以管理员身份运行”本程序
echo    按任意键退出后从新运行...
pause>nul
exit
)
echo.
echo.
echo.
:start
set /p vhd=请输入要锁定的驱动器盘符(例如E)
if "%vhd%"=="" goto start
if not "%vhd%"=="" set vhd=%vhd:~0,1%
manage-bde.exe -lock %vhd%: -fd
cls
echo.
echo.
echo.
echo    已完成锁定
ping -n 5 127.1  >nul
exit
[root@burvis ~]# fdisk /dev/sda

WARNING: DOS
-compatible mode is deprecated. It's strongly recommended to
       
switch off the mode (command 'c') and change display units to
        sectors (command 'u').

Command (m
for help):
  1. Redhat6.0  分区加密 
  2.   
  3. [root@honghaitao ~]# uname -r 
  4. 2.6.32-71.el6.i686 
  5.   
  6.   
  7. 一、新建一个分区/dev/sda6 
  8. [root@honghaitao ~]# fdisk -l /dev/sda 
  9.   
  10. Disk /dev/sda: 21.5 GB, 21474836480 bytes 
  11. 255 heads, 63 sectors/track, 2610 cylinders 
  12. Units = cylinders of 16065 * 512 = 8225280 bytes 
  13. Sector size (logical/physical): 512 bytes / 512 bytes 
  14. I/O size (minimum/optimal): 512 bytes / 512 bytes 
  15. Disk identifier: 0x0003458d 
  16.   
  17.    Device Boot      Start         End      Blocks   Id  System 
  18. /dev/sda1   *           1        1275    10240000   83  Linux 
  19. /dev/sda2            1275        1658     3072000   83  Linux 
  20. /dev/sda3            1658        1913     2048000   83  Linux 
  21. /dev/sda4            1913        2611     5610496    5  Extended 
  22. /dev/sda5            1913        2044     1048576   82  Linux swap / Solaris 
  23.   
  24. [root@honghaitao ~]# fdisk /dev/sda 
  25.   
  26. WARNING: DOS-compatible mode is deprecated. It's strongly recommended to 
  27.          switch off the mode (command 'c') and change display units to 
  28.          sectors (command 'u'). 
  29.   
  30. Command (m for help): m 
  31. Command action 
  32.    a   toggle a bootable flag 
  33.    b   edit bsd disklabel 
  34.    c   toggle the dos compatibility flag 
  35.    d   delete a partition 
  36.    l   list known partition types 
  37.    m   print this menu 
  38.    n   add a new partition 
  39.    o   create a new empty DOS partition table 
  40.    p   print the partition table 
  41.    q   quit without saving changes 
  42.    s   create a new empty Sun disklabel 
  43.    t   change a partition's system id 
  44.    u   change display/entry units 
  45.    v   verify the partition table 
  46.    w   write table to disk and exit 
  47.    x   extra functionality (experts only) 
  48.   
  49. Command (m for help): n 
  50. First cylinder (2044-2611, default 2044): 
  51. Using default value 2044 
  52. Last cylinder, +cylinders or +size{K,M,G} (2044-2611, default 2611): +50M 
  53.   
  54. Command (m for help): p 
  55.   
  56. Disk /dev/sda: 21.5 GB, 21474836480 bytes 
  57. 255 heads, 63 sectors/track, 2610 cylinders 
  58. Units = cylinders of 16065 * 512 = 8225280 bytes 
  59. Sector size (logical/physical): 512 bytes / 512 bytes 
  60. I/O size (minimum/optimal): 512 bytes / 512 bytes 
  61. Disk identifier: 0x0003458d 
  62.   
  63.    Device Boot      Start         End      Blocks   Id  System 
  64. /dev/sda1   *           1        1275    10240000   83  Linux 
  65. /dev/sda2            1275        1658     3072000   83  Linux 
  66. /dev/sda3            1658        1913     2048000   83  Linux 
  67. /dev/sda4            1913        2611     5610496    5  Extended 
  68. /dev/sda5            1913        2044     1048576   82  Linux swap / Solaris 
  69. /dev/sda6            2044        2050       54945+  83  Linux 
  70.   
  71. Command (m for help): w 
  72. The partition table has been altered! 
  73.   
  74. Calling ioctl() to re-read partition table. 
  75.   
  76. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. 
  77. The kernel still uses the old table. The new table will be used at 
  78. the next reboot or after you run partprobe(8) or kpartx(8) 
  79. Syncing disks. 
  80. [root@honghaitao ~]# partprobe 
  81.   
  82.   
  83.   
  84. 二、分区加密 
  85.   
  86. 1、对新分区进行加密,并设置密码: 
  87.  [root@honghaitao ~]# cryptsetup luksFormat /dev/sda6 
  88.   
  89. WARNING! 
  90. ======== 
  91. This will overwrite data on /dev/sda6 irrevocably. 
  92.   
  93. Are you sure? (Type uppercase yes): YES 
  94. Enter LUKS passphrase: 
  95. Verify passphrase: 
  96.   
  97.   
  98. 2、这个时候我们的分区已经被加密,我们要使用必须先解密 
  99. [root@honghaitao ~]# cryptsetup luksOpen /dev/sda6 tt 
  100. Enter passphrase for /dev/sda6: 
  101. [root@honghaitao ~]# ll /dev/mapper/tt 
  102. lrwxrwxrwx. 1 root root 7 Sep 21 05:16 /dev/mapper/tt -> ../dm-1 
  103. 这里通过luksOpen来进行解密 后面‘tt’可以写随意的名字,然后会将加密卷/dev/vda6解锁为/dev/mapper/tt 
  104.   
  105.   
  106. 3、解密的卷进行格式化 
  107.   
  108. [root@honghaitao ~]# mkfs.ext4 /dev/mapper/tt 
  109. mke2fs 1.41.12 (17-May-2010) 
  110. Filesystem label
  111. OS type: Linux 
  112. Block size=1024 (log=0
  113. Fragment size=1024 (log=0
  114. Stride=0 blocks, Stripe width=0 blocks 
  115. 3184 inodes, 12732 blocks 
  116. 636 blocks (5.00%) reserved for the super user 
  117. First data block=1 
  118. Maximum filesystem blocks=13107200 
  119. 2 block groups 
  120. 8192 blocks per group, 8192 fragments per group 
  121. 1592 inodes per group 
  122. Superblock backups stored on blocks: 
  123.         8193 
  124.   
  125. Writing inode tables: done                            
  126. Creating journal (1024 blocks): done 
  127. Writing superblocks and filesystem accounting information: done 
  128.   
  129. This filesystem will be automatically checked every 29 mounts or 
  130. 180 days, whichever comes first.  Use tune2fs -c or -i to override. 
  131.   
  132. 4、把分区挂载到我们的系统上 
  133. -----在/mnt 下建立目录/data 
  134. [root@honghaitao mnt]# mkdir data 
  135. [root@honghaitao mnt]# ls 
  136. Data 
  137.   
  138. -----将分区挂载到/data目录中 
  139. [root@honghaitao mnt]# mount /dev/mapper/tt   /mnt/data/ 
  140.   
  141. 5、复制文件 
  142. [root@honghaitao mnt]# cp -r /etc/  /mnt/data/ 
  143.   (由于分区太小,复制的过程中会报错) 
  144. [root@honghaitao ~]# df -h 
  145. Filesystem            Size  Used Avail Use% Mounted on 
  146. /dev/sda1             9.7G  419M  8.8G   5% / 
  147. tmpfs                 504M   88K  504M   1% /dev/shm 
  148. /dev/sda3             2.0G   36M  1.8G   2% /home 
  149. /dev/sda2             2.9G  2.0G  826M  71% /usr 
  150. /dev/mapper/tt         13M   13M     0 100% /mnt/data 
  151.   
  152.   
  153.   
  154. [root@honghaitao mnt]# blkid 
  155. /dev/sda1: UUID="63a6cc5c-0700-416b-b7a4-6b18a1700d6c" TYPE="ext4" 
  156. /dev/sda2: UUID="16178a07-5a60-4ac2-b467-4bc92fc750e8" TYPE="ext4" 
  157. /dev/sda3: UUID="0f428181-bcb7-4167-a3ad-7e9ed3a1ac1c" TYPE="ext4" 
  158. /dev/sda5: UUID="a62d24e8-6700-4d31-90e4-87a9930d20b5" TYPE="swap" 
  159. /dev/sda6: UUID="4983206d-9a9d-4b3e-a5b6-fa030c515645" TYPE="crypto_LUKS" 
  160. /dev/mapper/tt: UUID="c628b5ae-5680-441e-88dc-b49e542073ef" TYPE="ext4" 
  161.   
  162.   
  163. 三、设置为开机启动,开机提示输入密码: 
  164.   
  165. 1、  添加条目到/etc/fstab,确保在下次启动生效: 
  166.   
  167. UUID="c628b5ae-5680-441e-88dc-b49e542073ef"     /mnt/data       ext4    defaults        0 0 
  168.   
  169. 2、  添加条目到/etc/crypttab中,确保下次启动的时候提示输入密码 
  170.   
  171. data    UUID="4983206d-9a9d-4b3e-a5b6-fa030c515645" 
  172.   
  173. 下次启动的时候会出现下图,提示输入密码 
  174.    不输密码,系统都不能进,疼。。。 
  175.   
  176.   
  177. 不用的时候可以先卸载再锁住,这样数据就能保护起来: 
  178. 卸载: 
  179. [root@honghaitao ~]# umount /dev/mapper/tt 
  180. [root@honghaitao ~]# cryptsetup luksClose tt 
  181. 如果下次先再用,就重复luksOpen就可以了: 
  182. [root@honghaitao ~]# cryptsetup luksOpen /dev/sda6 tt 
  183. [root@honghaitao ~]# mount /dev/mapper/tt 
  184.   
  185. OK! 
  1. [root@burvis~]#fdisk/dev/sda  
  2.  
  3. WARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedto  
  4.  
  5. switchoffthemode(command'c')andchangedisplayunitsto  
  6.  
  7. sectors(command'u').  
  8.  
  9. Command(mforhelp):  
  10.  
  1. [root@burvis~]#fdisk/dev/sda
  2. WARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedto
  3. switchoffthemode(command'c')andchangedisplayunitsto
  4. sectors(command'u').
  5. Command(mforhelp):
This will overwrite data on /dev/vdb1 irrevocably. 
 Are you sure? (Type uppercase yes): YES ##确定加密 
 Enter passphrase: ##密码大于8位,并且不能太简单 
 Verify passphrase: ##确认密码
fdisk -cu /dev/sda
cat /proc/partitions
major minor  #blocks  name
   7        0    3351190 loop0
   8        0   20971520 sda
   8        1     204800 sda1
   8        2    5120000 sda2
   8        3    1024000 sda3
   8        4       1024 sda4
   8        5     102400 sda5
 253        0    4096000 dm-0
 253        1    1019904 dm-1partx -d /dev/sda
partx -a /dev/sda
 mkfs.ext4 /dev/sda5
import subprocess

def encrypt_partition(device, passphrase):
    # 使用cryptsetup命令创建加密设备
    subprocess.run(['cryptsetup', 'luksFormat', device])
    
    # 打开加密设备
    subprocess.run(['cryptsetup', 'luksOpen', device, 'encrypted_partition'])
    
    # 格式化加密设备
    subprocess.run(['mkfs.ext4', '/dev/mapper/encrypted_partition'])
    
    # 挂载加密设备
    subprocess.run(['mount', '/dev/mapper/encrypted_partition', '/mnt'])
    
    # 将密钥写入文件
    with open('/mnt/passphrase', 'w') as f:
        f.write(passphrase)
    
    # 卸载加密设备
    subprocess.run(['umount', '/mnt'])
    
    # 关闭加密设备
    subprocess.run(['cryptsetup', 'luksClose', 'encrypted_partition'])
public ChannelDatas(Context context) {
    this.mySettings = new MySettings(context);

    //这里是在生成之后AES解密用的key
    //pmd5(string)是取md5
    //SplashActivity.sKey是动态生成的密匙
    //getSettingStr("rand")是从SharedPreferences取"rand"
    String substring = AES.pmd5(SplashActivity.sKey + new MySettings(PlayerActivity.context).getSettingStr("rand")).substring(7, 7 + 16);
    try {
        //读取文件
        this.jsonString = ChannelManager.readfile(context, FILE_DATA);

        //文件内容做变换
        this.jsonString = this.jsonString.substring(64);
        this.jsonString = this.jsonString.substring(64);
        this.jsonString = this.jsonString.replace("f", "#");
        this.jsonString = this.jsonString.replace("b", "f");
        this.jsonString = this.jsonString.replace("#", "b");
        this.jsonString = this.jsonString.replace("t", "%");
        this.jsonString = this.jsonString.replace("y", "t");
        this.jsonString = this.jsonString.replace("%", "y");

        //变化后使用AES解密
        this.jsonString = AES.Decrypt(this.jsonString, substring);

        //解密后Base64解密一道再解压一次得到
        this.jsonString = new String(gzuncompress(Base64.decode(this.jsonString, 0)), "UTF-8");
    } catch (Exception e) {
        e.printStackTrace();
        new MySettings(PlayerActivity.context).saveVersion(0);
        Toast.makeText(PlayerActivity.context, "解析节目数据失败!请重新启动软件!", 1).show();
    }
}

/**
 * AES解密工具
 * str为要解密的内容,str2为密匙
 */
public static String Decrypt(String str, String str2) throws Exception {
    if (str2 == null) {
        try {
            System.out.print("Key为空null");
            return null;
        } catch (Exception e) {
            System.out.println(e.toString());
            return null;
        }
    } else if (str2.length() != 16) {
        System.out.print("Key长度不是16位");
        return null;
    } else {
        SecretKeySpec secretKeySpec = new SecretKeySpec(str2.getBytes("utf-8"), "AES");
        Cipher instance = Cipher.getInstance("AES/ECB/PKCS5Padding");
        instance.init(2, secretKeySpec);
        try {
            return new String(instance.doFinal(Base64.decode(str, 0)), "utf-8");
        } catch (Exception e2) {
            System.out.println(e2.toString());
            return null;
        }
    }
}

/**
 * 解压方法
 */
public static byte[] gzuncompress(byte[] bArr) {
    byte[] bArr2 = null;
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bArr.length);
    Inflater inflater = new Inflater();
    try {
        inflater.setInput(bArr);
        byte[] bArr3 = new byte[256];
        while (!inflater.finished()) {
            byteArrayOutputStream.write(bArr3, 0, inflater.inflate(bArr3));
        }
        bArr2 = byteArrayOutputStream.toByteArray();
        byteArrayOutputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    } catch (Throwable th) {
        inflater.end();
        throw th;
    }
    inflater.end();
    return bArr2;
}
// 从 Assets 读取 Bitmap
Bitmap bitmap = null;
try {
    bitmap = BitmapFactory.decodeStream(getAssets().open("test.jpg"));
} catch (IOException e) {
    e.printStackTrace();
}

if (bitmap == null) return;

// 获取保存文件的 Uri
ContentResolver contentResolver = getContentResolver();
ContentValues values = new ContentValues();
Uri insertUri = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);

// 保存图片到 Pictures 目录下
if (insertUri != null) {
    OutputStream os = null;
    try {
        os = contentResolver.openOutputStream(insertUri);
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } finally {
        try {
            if (os != null) {
                os.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
espsecure.py generate_flash_encryption_key key.bin
[root@desktop21 Desktop]# vgdisplay 

  --- Volume group ---

  VG Name               vol0

  System ID             

  Format                lvm2

  Metadata Areas        2

  Metadata Sequence No  27

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                4

  Open LV               3

  Max PV                0

  Cur PV                2

  Act PV                2

  VG Size               55.22 GiB

  PE Size               32.00 MiB

  Total PE              1767

  Alloc PE / Size       928 / 29.00 GiB

  Free  PE / Size       839 / 26.22 GiB (还26G,够了吧,我只需要300M做实验)

  VG UUID               ZAGsPK-tIBO-08bd-RoMp-fPeC-Ei5l-x3asx6

 

[root@desktop21 Desktop]# lvcreate -L 300M -n testlv /dev/vol0 

  Rounding up size to full physical extent 320.00 MiB

  Logical volume "testlv" created
create table par_tab (name string,nation string) partitioned by (sex string) row format delimited fields terminated by ',';
创建主表:
create table table_name (...)
   [ partition by { range | list } ({ column_name | ( expression )})]
[root@servera ~]# fdisk /dev/vdb

Command (m for help): n  # 创建新分区 Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p  # 创建主分区 Partition number (1-4, default 1):   # 回车 First sector (2048-10485759, default 2048):   # 回车,设置起始扇区 Last sector, +sectors or +size{K,M,G,T,P} (2048-10485759, default 10485759): 409600  # 设置结尾扇区 Created a new partition 1 of type 'Linux' and of size 199 MiB. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p  # 创建主分区 Partition number (2-4, default 2):   # 回车 First sector (409601-10485759, default 411648):   # 回车,设置起始扇区 Last sector, +sectors or +size{K,M,G,T,P} (411648-10485759, default 10485759): 819200  # 设置结尾扇区 Created a new partition 2 of type 'Linux' and of size 199 MiB.
Command (m for help): w  # 保存配置 The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@servera ~]# fdisk -l /dev/vdb Disk /dev/vdb: 5 GiB, 5368709120 bytes, 10485760 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x03864530 Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 409600 407553 199M 83 Linux /dev/vdb2 411648 819200 407553 199M 83 Linux
**** 创建一个商品零售表,然后为该表按照销售日期所在的季度创建4个分区,代码:

SQL> create table ware_retail_part	-- 创建一个描述商品零售的数据表
(
	id integer primary key,			-- 销售编号
	retail_date date,				-- 销售日期
	ware_name varchar2(50)			-- 商品名称
)
partition by range(retail_date)
(
	-- 2019年第一个季度为par_01分区
	partition par_01 values less than(to_date('2019-04-01','yyyy-mm-dd')) tablespace TBSP_1,
	-- 2019年第二个季度为par_02分区
	partition par_02 values less than(to_date('2019-07-01','yyyy-mm-dd')) tablespace TBSP_1,
	-- 2019年第三个季度为par_03分区
	partition par_03 values less than(to_date('2019-10-10','yyyy-mm-dd')) tablespace TBSP_2,
	-- 2019年第四个季度为par_04分区
	partition par_04 values less than(to_date('2020-01-01','yyyy-mm-dd')) tablespace TBSP_2
);

表已创建。
最多4个主分区。
       主分区是一个比较单纯的分区,通常位于硬盘的最前面一块区域中,构成逻辑C磁盘。在主分区中,不允许再建立其它逻辑磁盘。
       扩展分区的概念则比较复杂,也是造成分区和逻辑磁盘混淆的主要原因。由于硬盘仅仅为分区表保留了64个字节的存储空间,而每个分区的参数占据16个字节,故主引导扇区中总计可以存储4个分区的数据。操作系统只允许存储4个分区的数据,如果说逻辑磁盘就是分区,则系统最多只允许4个逻辑磁盘。对于具体的应用,4个逻辑磁盘往往不能满足实际需求。为了建立更多的逻辑磁盘供操作系统使用,系统引入了扩展分区的概念。
       所谓扩展分区,严格地讲它不是一个实际意义的分区,它仅仅是一个指向下一个分区的指针,这种指针结构将形成一个单向链表。这样在主引导扇区中除了主分区外,仅需要存储一个被称为扩展分区的分区数据,通过这个扩展分区的数据可以找到下一个分区(实际上也就是下一个逻辑磁盘)的起始位置,以此起始位置类推可以找到所有的分区。无论系统中建立多少个逻辑磁盘,在主引导扇区中通过一个扩展分区的参数就可以逐个找到每一个逻辑磁盘
       需要特别注意的是,由于主分区之后的各个分区是通过一种单向链表的结构来实现链接的,因此,若单向链表发生问题,将导致逻辑磁盘的丢失。 
【查看是否支持分区】
show variables like "%part%";
【如何查看mysql分区信息】
select * from INFORMATION_SCHEMA.PARTITIONS where table_name='user'; (这里查看user表的分区信息)
【查看执行一条查询SQL会扫描的分区】
explain partitions select * from user where id=10;
【如何创建分区】
1.建表时就分区:CREATE TABLE IF NOT EXISTS `user` ( 
   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID', 
   `name` varchar(50) NOT NULL DEFAULT '' COMMENT '名称', 
   `sex` int(1) NOT NULL DEFAULT '0' COMMENT '0为男,1为女', 
   PRIMARY KEY (`id`) 
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 
PARTITION BY RANGE (id) ( 
     PARTITION p0 VALUES LESS THAN (3), 
     PARTITION p1 VALUES LESS THAN (6), 
     PARTITION p2 VALUES LESS THAN (9), 
     PARTITION p3 VALUES LESS THAN (12), 
     PARTITION p4 VALUES LESS THAN MAXVALUE 
);2.对现有表进行分区:可以对现有表进行分区,并且会按規则自动的将表中的数据分配相应的分区中
alter table 表名 partition by RANGE(字段) 
(PARTITION p1 VALUES less than (1), 
PARTITION p2 VALUES less than (5), 
PARTITION p3 VALUES less than MAXVALUE);【删除一个分区】
(当删除了一个分区,也同时删除了该分区中所有的数据)
ALTER TABLE 表名 DROP PARTITION p2;【分区合并】
下面的SQL,将p201001 - p201009 合并为3个分区p2010Q1 - p2010Q3ALTER TABLE sale_data
    REORGANIZE PARTITION p201001,p201002,p201003,
 
    p201004,p201005,p201006,
 
    p201007,p201008,p201009 INTO
 
    (
 
    PARTITION p2010Q1 VALUES LESS THAN (201004),
 
    PARTITION p2010Q2 VALUES LESS THAN (201007),
 
    PARTITION p2010Q3 VALUES LESS THAN (201010)
 
   );【分区的拆分】
下面的SQL,将p2010Q1 分区,拆分为s2009 与s2010 两个分区ALTER TABLE sale_data REORGANIZE PARTITION p2010Q1 INTO (
 
   PARTITION s2009 VALUES LESS THAN (201001),
            
    PARTITION s2010 VALUES LESS THAN (201004)
 
   );
D:\wamp64\wamp\bin\mysql\mysql5.6.17\bin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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 |
| test |
+--------------------+
2 rows in set (0.01 sec)

mysql> use test
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| cadrs |
| wadr |
+----------------+
2 rows in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.17 |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE TABLE t3 ( col1 INT NOT NULL, col2 DATE NOT NULL, col3 INT NOT NULL, col4 INT
NOT NULL, UNIQUE KEY (col1, col2, col3) )PARTITION BY RANGE( col3 ) ( PARTITION p1 VALUES LESS T
HAN (11), PARTITION p2 VALUES LESS THAN (15));
Query OK, 0 rows affected (0.05 sec)

mysql> show COLUMNS FROM t3;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| col1 | int(11) | NO | PRI | NULL | |
| col2 | date | NO | PRI | NULL | |
| col3 | int(11) | NO | PRI | NULL | |
| col4 | int(11) | NO | | NULL | |
+-------+---------+------+-----+---------+-------+
4 rows in set (0.02 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.17 |
+-----------+
1 row in set (0.00 sec)

mysql>
  • 1
  • 2
  • 3
  • 4
  • 5