How can i use another data folder for mySQL?

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

How can i use another data folder for mySQL?

Postby web.designer.iq » 14. November 2009 14:00

Hi
I've a MySQL data folder in /home/MySQL-Data
How can i use this folder as default for MySQL Data (Databases)?
web.designer.iq
 
Posts: 4
Joined: 14. November 2009 13:56

Re: How can i use another data folder for mySQL?

Postby Nobbie » 14. November 2009 14:40

Yes.

If you use Xampp, edit /opt/lampp/bin/mysql.server and search for "datadir". You will find an empty assignment like:

Code: Select all
datadir=


Simply apply the folder you like and restart MySQL.

If you dont use Xampp, you may as well edit the MySQL Configuration file my.cnf (usually in /etc) and search for the section [mysqld]. Apply the datadir=/home/... Directive there and alsol restart MySQL.

And finally proceed to http://dev.mysql.com/doc/refman/5.1/en/ ... files.html and read about how to configure MySQL runtime options (for future questions).

P.S.: Beware you grant the desired permissions to the datadir folder, as MySQL server usually runs with different userid than yours.
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04

Re: How can i use another data folder for mySQL?

Postby xsoho » 24. November 2009 09:22

I done!!
but there are error in the starting MysQL!~!!
xsoho
 
Posts: 3
Joined: 24. November 2009 09:07

Re: How can i use another data folder for mySQL?

Postby Nobbie » 24. November 2009 10:49

And? I cannot read your minds and I cannot watch your screen. Will you please tell us what kind of errors? Any messages?

P.S.: When you want to use a different data folder than the default folder, you MUST OF COURSE copy all the contents of the default data folder to the new data folder. You CANNOT use multiple data folders. And (once again): you have to grant appropriate permissions to the data folder (and all folders and files beyond).
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04

Re: How can i use another data folder for mySQL?

Postby xsoho » 24. November 2009 10:55

Hi
I've a MySQL data folder in /www/mysql ,the partition is different from /opt/lampp/var /mysql
How can i use this folder as default for MySQL Data (Databases)?

Msn :fm3698@gmail.com
xsoho
 
Posts: 3
Joined: 24. November 2009 09:07

Re: How can i use another data folder for mySQL?

Postby Nobbie » 24. November 2009 11:19

Look above and read my first answer in the thread.
Nobbie
 
Posts: 8775
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests