请问MySQL解压版如何创建默认“Data”文件夹?
是不是在my.ini指定路径后就可以自动生成?

解决方案 »

  1.   

    去bin目录
      

  2.   


    求教,用什么指令或工具?以前LINUX有一个mysql_install_db的,但Windows上边如何搞咧?
      

  3.   


    求教,用什么指令或工具?以前LINUX有一个mysql_install_db的,但Windows上边如何搞咧?
    同样
      

  4.   

    1.这个我前段时间刚好用过,解压版里默认就有data文件夹好吧,下面还有基本表:mysql,test呢,所以不用管data目录。
    2.my.ini如果指定了data目录,那么这个目录就用手动去建立,不仅如此,还需要把之前的data下的mysql,test都要复制过去,不然启动mysql报错的。
      

  5.   

    手动建立目录是需要的,然后就直接使用c:\mysql\bin\mysql_install_db -dd:\data这样形式即可,如果没有旧数据不用拷贝什么文件d:\data>c:\mysql\bin\mysql_install_db --help
    mysql_install_db.exe  Ver 1.00 for Windows
    Copyright (C) 2010-2011 Monty Program Ab & Vladislav Vaintroub
    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
    Usage: mysql_install_db.exe [OPTIONS]
    OPTIONS:
      -?, --help Display this help message and exit.
      -d, --datadir=name Data directory of the new database
      -S, --service=name Name of the Windows service
      -p, --password=name Root password
      -P, --port=# mysql port
      -W, --socket=name named pipe name (if missing, it will be set the same as service)
      -D, --default-user Create default user
      -R, --allow-remote-root-access Allows remote access from network for user root
      -N, --skip-networking Do not use TCP connections, use pipe instead
      -s, --silent Print less information
      -o, --verbose-bootstrap Include mysqld bootstrap output
      

  6.   

    手动建立目录是需要的,然后就直接使用c:\mysql\bin\mysql_install_db -dd:\data这样形式即可,如果没有旧数据不用拷贝什么文件d:\data>c:\mysql\bin\mysql_install_db --help
    mysql_install_db.exe  Ver 1.00 for Windows
    Copyright (C) 2010-2011 Monty Program Ab & Vladislav Vaintroub
    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
    Usage: mysql_install_db.exe [OPTIONS]
    OPTIONS:
      -?, --help Display this help message and exit.
      -d, --datadir=name Data directory of the new database
      -S, --service=name Name of the Windows service
      -p, --password=name Root password
      -P, --port=# mysql port
      -W, --socket=name named pipe name (if missing, it will be set the same as service)
      -D, --default-user Create default user
      -R, --allow-remote-root-access Allows remote access from network for user root
      -N, --skip-networking Do not use TCP connections, use pipe instead
      -s, --silent Print less information
      -o, --verbose-bootstrap Include mysqld bootstrap output我安装版和解压版都没有mysql_install_db这个文件,这是咋回事呢?
    我一般是直接复制mysql和test目录就可以了。
      

  7.   

    我是在是mariadb(mysql原作者提供的版本)官网上下载5.5.32版本,里面有mysql_install_db等工具。
    复制当然也没有啥问题,只是我一般喜欢在新部署的机器上新建所有参数,所以尽量使用命令行。你也可以解压程序后用复制的方法更改了data路径,在把mysql\data拷贝到新路径后,修改my.ini文件,“datadir=d:\data”这种,不过要自建windows service(c:\mysql\bin\mysqld.exe --defaults-file=d:\my.ini mysql #用mysql_install_db总是把my.ini创建在data目录中,所以我也就按这个方式#)。总之mysql很灵活,不用mysql_install_db也是一样的。
      

  8.   

    我是在是mariadb(mysql原作者提供的版本)官网上下载5.5.32版本,里面有mysql_install_db等工具。
    复制当然也没有啥问题,只是我一般喜欢在新部署的机器上新建所有参数,所以尽量使用命令行。你也可以解压程序后用复制的方法更改了data路径,在把mysql\data拷贝到新路径后,修改my.ini文件,“datadir=d:\data”这种,不过要自建windows service(c:\mysql\bin\mysqld.exe --defaults-file=d:\my.ini mysql #用mysql_install_db总是把my.ini创建在data目录中,所以我也就按这个方式#)。总之mysql很灵活,不用mysql_install_db也是一样的。MYSQL 是没有mysql_install_db,MARIADB有。不知道通不通用不……?如果复制DATA目录的话不知道吉利不。