When I want to create a database by through MySQL Workbench 6.1 CE the database always creates at "C:\ProgramData\MySQL\MySQL Server 5.6\data\". But I want to save it in my desired folder. How do I do that?
It happens because this is the data directory used by the server. If you want to change it then modify the datadir value in the my.cnf file, and then restart MySQL.
I don't know how it works with Windows permissions, but in linux the new data directory must be owned by the same user running the MySQL server (usually mysql) with write, read and execution permissions for the owner, and only read and execution permissions for groups and other users.
I don't know how Workbench handles this task, but when changing the path you have to move the data to the new location and you have to restart the database, otherwise it will continue to use the configuration options in memory.
For a detailed explanation read the documentation:
actually it is caused of MySQL always save the database in the default folder and as far as I know we can change it if we change the configuration file. I have done it before but I don't remember the file name.
Try to find the file usually with .ini or with .conf extension under MySQL folder. it is a text file remember use notepad or vi to edit this file and again remember to bacup this file before you start to edit. find the line with contain ...\data and change it to the folder that you want.
But be carefull, use this precaution:
1. backup your data first
2. copy the data to your folder
3. backup the configuration file before you start
4. edit it with notepad or vi, don't use any word processor program
5. restart MySQLafter finishing