Page 1 of 1

share mysql data folder between linux and windows

PostPosted: 16. October 2006 22:09
by virtualj
I have a dual boot with windows and linux. On both I have xampp running and I configured the httpd.conf file so that they use the same httpdoc folder.
But I allso want them to use the same database.
I found that I need to change datadir in my.cnf
But in my linux install of xampp there is no datadir in the my.cnf file.
the only reference to the data dir was this:
Code: Select all
skip-innodb
innodb_data_home_dir = /opt/lampp/var/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /opt/lampp/var/mysql/
innodb_log_arch_dir = /opt/lampp/var/mysql/

so I changed those to the mounted fat partition directory.
But when I restart MYSQL it still uses the old databases and datadir.

It looks like my.cnf is ignored.
Can anyone help me?

thanks

BUMP

PostPosted: 24. December 2006 05:51
by josejorge
I have the same problem, does anybodu know how to change the folder in which the MySQL databases are stored ??? Thanks beforehand ! :D

Re: BUMP

PostPosted: 02. April 2008 12:23
by jimwill
josejorge wrote:I have the same problem, does anybodu know how to change the folder in which the MySQL databases are stored ??? Thanks beforehand ! :D


No one knows how to do this :?: :?: :?:
Since 2006!!
I guess I may as well give up then, must not be do-able :!:

(Think I'll go play solitaire!)

Changing the xampp datadir

PostPosted: 18. November 2008 11:37
by florentin
When you start xampp on linux with "/opt/lampp/lampp start", you automatically set datadir to /opt/lampp/var/mysql and adding your own datadir to my.cnf won't help.

Not sure if you like this solution, but this is how i've done:

1. rename /opt/lampp/var/mysql to /opt/lampp/var/mysqlbk
2. create a symbolic link like that
ln -s /location/to/the/new/mysql/data /opt/lampp/var/mysql
where /location/to/the/new/mysql/data is your new mysql data directory (also used by the mysql from windows)
3. restart lampp: /opt/lampp/lampp restart

If you had a mysql root password in windows, you should be aware that you phpmyadmin from linux wont' work. Edit the /opt/lampp/phpmyadmin/config.inc.php and add your password there.

Re: share mysql data folder between linux and windows

PostPosted: 04. December 2008 04:19
by AlZuwaga
Thanks florentin, your information was exelent for me :D

Re: share mysql data folder between linux and windows

PostPosted: 28. October 2010 19:24
by mrodent
Dear all,

Don't know if this is any help.

Installed my MySQL as part of the XAMPP package

Turns out the configuration file for location of MySQL data is at
/opt/lampp/bin/mysql_config
... search for "ldata"

Maybe mysql_config can be found in other locations due to other installation processes... appears my.cnf is, er, ignored (?)

Re: share mysql data folder between linux and windows

PostPosted: 14. November 2010 16:27
by cpighin
Thanks florentin, your information helped my very much on having success; now I can manage my database under Ubuntu and Windows.

Claudio :D