比如key分区,给某张表tb分区8个,在My.ini配置中有innodb_data_home_dir = F:\\mysql\\data\\ 和
innodb_data_file_path = ibdata1:1024M:autoextend但是通过分区( ALTER TABLE tb ADD PARTITION PARTITIONS 8;)后
该表tb的8个分区存储都到默认的路径datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"里去了求高手不吝赐教!!!谢谢啊!MySQL分区存储

解决方案 »

  1.   

    如果系统中有mklink,可以
     Windows Vista, Windows Server 2008, or newer have native symbolic link support
      

  2.   


    试过了 ,我参照网上介绍
    在Windows中,通过在数据目录中创建一个文件,该文件包含目标目录的路径,你可以为MySQL数据库创建一个符号链接。该文件应该被命名为db_name.sym,其中db_name是数据库名。假定MySQ数据目录是C:\mysql\data并且你想要数据库foo放置在D:\data\foo。设置一个符号链接如下所示:1.    确保D:\data\foo目录存在,如果必要创建它。如果你在数据目录内有一个命名为foo的数据库目录,你应移动它到D:\data目录。否则,符号链接无效。为避免出现问题,当你移动数据库目录时服务器不应该运行。2.    创建一个文本文件C:\mysql\data\foo.sym,该本文文件包含路径名D:\data\foo\。此后,数据库foo创建的所有表将创建在D:\data\foo文件中。请注意,如果在MySQL数据目录中存在同名的数据库目录,不能使用符号链接。这种方法简历符号链接后,依然不能将数据保存到D盘目录去,还是保存在原目录??
      

  3.   

    no
    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. 
      

  4.   


    麻烦告诉我下具体点的写法”
    如 原存储路径 “C\mysql\data\mydb”
    现在想指定到 “D\mysql\data\mydb”
    这个symlink 文件具体该怎么写??
    谢谢!
      

  5.   

    你仔细看过别人的回复没有?必须支持mklink,(不是什么symlink 文件)
     比如WINXP下就不行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. 
      

  6.   


    呵呵,既然这么看重将数据库存放在不同的硬盘,那就更换操作系统为LINUX
      

  7.   


    好的 知道了 mklink /d 在win7命令行显示权限不够怎么办?》
      

  8.   

    在WIN7下对登录WIN7的用户授权