Linux XAMPP - newb struggling to change MySQL DATADIR

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Linux XAMPP - newb struggling to change MySQL DATADIR

Postby mrodent » 30. October 2010 15:39

Hi all,

Have worked out how to
- 1) rename /opt/lampp/var/mysql as mysqlbk
- 2) create a symbolic link placed in /opt/lampp/var called "mysql" which links to another directory somewhere else.

This works... but only if you do
# chown -R nobody [...]/mysql
on the new directory in question (i.e. where you want your data files kept).

So far so good... took me a bit of sweat to find out that mysqld under xampp is running in a process owned by "nobody".
BUT... in fact I want my database files to be kept on a Truecrypt volume... inevitably when this runs it runs in *somebody*'s Truecrypt process... so in fact even root finds it impossible to change the ownership of the directories and files in it to "nobody".

Consequently any attempt to use a symbolic link pointing to a directory in such a mounted Truecrypt volume means that mysql won't start.

Surely running a process like mysqld in a process owned by "nobody" is pretty bad security practice anyway !? Does anyone know how you go about running it in a "proper" process?

For that matter does anyone know how to configure xampp-mysql so you don't have to use a workaround symbolic link arrangement as described above? I.e. how exactly do you change the DATADIR??? It certainly isn't by changing stuff in /opt/lampp/etc/my.cnf, as I have found out this afternoon after several frustrating hours!

Thanks
mrodent
 
Posts: 5
Joined: 28. October 2010 19:20

Re: Linux XAMPP - newb struggling to change MySQL DATADIR

Postby mrodent » 30. October 2010 16:01

... innumerable experiments later... all to no avail.

I'm mainly concentrating on this question now: is it *possible* to get XAMPP-MySQL to run in a process owned by someone other than "nobody"???

Nobody is going nowhere, for me.

Also, following an ubuntu forum thread, I wondered if I could get mysql operating on its own without going through the XAMPP-up.

root@E6410:# /opt/lampp/bin/mysql -u root -p
Enter password: [correct password]
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)

... oww... horrible. Wassit all mean??

If all else fails I install a standalone version of MySQL... and if necessary uninstall XAMPP.

Help!
mrodent
 
Posts: 5
Joined: 28. October 2010 19:20

Re: Linux XAMPP - newb struggling to change MySQL DATADIR

Postby Bigbread » 31. October 2010 20:42

Hey mrodent, I had the same objective:
I want my database files to be kept on a Truecrypt volume
but I went about it in a slightly different way.

I have my database files in a tc volume formatted with FAT32 (actually shared by XAMPP under WinXP but that's beside the point).

I mount the volume in Linux with Options

Mount at directory: portable
Mount options: umask=000

(the first is for consistency - a directory I created in my home folder - and the second is to ensure lampp gets all the permissions it needs)

To get it working I had to do this (just the once)

Copy /opt/lampp/etc/my.conf to /opt/lampp/var/mysql/my.cnf and add this line after socket under [mysqld]:

datadir = /home/bigbread/portable/xampp/mysql/data

(your path will obviously be different)

Hope this helps.
Bigbread
 
Posts: 17
Joined: 12. May 2007 12:05

Re: Linux XAMPP - newb struggling to change MySQL DATADIR

Postby Coastalguy » 10. March 2011 20:15

Tried what BigBread advised to

1. copy the my.cnf from /opt/lampp/etc/ to /opt/lampp/var/mysql/my.cnf.
2. I then added the line for datadir to the copied version under /opt/lampp/var/ as Bigbread didn't advise whether to
add it to the original of the copied version.
3. After I did this, mysql would no longer start.
4. Tried adding the datadir to the original also and mysql still would not start.
5. Removed the datadir from both and mysql started ok, except that it advised it was still running. Apparently, with this change, mysql wouldn't stop, so I rebooted and everything then stopped.

I now notice that BigBread advised to add the datadir under the socket line, where I added it as the first line under [mysqld]. Does this make a difference?
Coastalguy
 
Posts: 47
Joined: 06. March 2011 21:06
Operating System: Windows 7 Home Premium


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests