mysql5.6可以指定ibd的DATA DIRECTORY

解决方案 »

  1.   

    1
    使用innodb_file_per_table为每个表使用独立的表空间
    2
    mysql help
    Windows Vista, Windows Server 2008, or newer have native symbolic link support, so you can create a symlink using the mklink command. This command requires administrative privileges.     Change location into the data directory:     C:\> cd \path\to\datadir     In the data directory, create a symlink named mydb that points to the location of the database directory:     C:\> mklink /d mydb D:\data\mydb After this, all tables created in the database mydb are created in D:\data\mydb. 
      

  2.   

    innodb_data_file_path
    这个参数可以分散io,分到不到磁盘
      

  3.   

    windows  下不行, linux 下可以创建文件符号。
      

  4.   

    innodb_data_file_path = /ibdata/ibdata1:988M;/disk2/ibdata2:50M:autoextend
    这里头,本来就可以指定到不同的磁盘分区啊,
    不知道楼主到底想问什么?
      

  5.   

    首先感谢各位的热心回复innodb_data_file_path = /ibdata/ibdata1:988M;/disk2/ibdata2:50M:autoextend 
    这么配置可以分散ibd文件,真正的数据存放在datadir=指定的目录下,现在的情况是datadir目录所在的分区快满了。使用软连接也是一个不错的方案,现在问题就出在,只有一个数据库,所用的数据表都存放在这一个数据库中,
      

  6.   

    嗯,谢谢回复,研究一下软连接,不知道InnoDB软连接是否可靠,mysql手册中有这样一段话
    Symlinks are fully supported only for MyISAM tables. For files used by tables for other storage engines, you may get strange problems if you try to use symbolic links. For InnoDB tables, use the alternative technique explained in Section 14.2.5.4, “Specifying the Location of a Tablespace” instead.