Mandriva Expert
The place where your Mandriva Linux system finds support

datadir MySql

+/- details
User cdspjohn
Incident Number 47163
Date 2002/12/27 20:56
Status Incident closed
Paid No

Product 9.0 (Dolphin)
Architecture x86_32
Scope Databases

Products owned
Community Support question - to convert into a paid question, click here

Lines in bold below have not yet been seen by the customer - those in blue are from the customer

Username : Date : Action : Comments [ close all ]    
 
cdspjohn : 27/12/02 08:56 PM : Incident created
-   We have a new Mandrake 9 server up and running with MySql package installed.

I wanted to change the default datadir from /var/lib/mysql to /home/alldta (a directory which I changed to being owned by the mysql user)

However when I start MySql
/usr/bin/safe_mysqld --datadir=/home/alldta

The MySql does not start.

The other part of my question id ther is not my.cnf in the /var/lib/mysql directory. Do I need to copy one of the template cnf files from /usr/share/mysql to /var/lib/mysql?

This will be for a small organization's website for a dabase accsed from the the web via Apache so how do you know which my-size.cnf file to copy?

The other question is the location of MySql itself.

Is /var/lib/mysql where it belongs? I have the O'Reilly book on mYSql but they do not go into the a lot of detail for the different distributions.

Thank You

 
Linegod_7611 : 27/12/02 10:39 PM : Reply received
-   Create a copy of the 'my-size.cnf' file you want to use, call it 'my.cnf' and place
it in '/etc'. This is where the startup script will look for it
(/etc/rc.d/init.d/mysql). You should always start and stop mysql with
'/etc/rc.d/init.d/mysql start' '/etc/rc.d/init.d/mysql stop'. This script has taken
into account many of the recommendations of the O'Reilly book and others.

This brings us back to your first (and last) questions. Unless you have a
specific reason for moving mysql, it will be much better to leave it in it's proper
position (proper for Mandrake anyway). By changing this location, you will end
up breaking alot of scripts. If you still want to create a different directory, you
can always symbolically link it to the new directory, so that nothing else gets
messed up (make a backup of your data first):

# rm -rf /home/alldta
# mv /var/lib/mysql /home/alldta
# ln -s /home/alldta /var/lib/mysql

As a note, when reading any documentation on Linux, you must remember that
there are dozens of different ways to configure many applications, but
distributions such as Mandrake (Redhat, Debian, etc) have already done much
of the configuration and installation work.

The MySQL that comes with Mandrake works straight out of the box. If I
where you, I would leave the settings as they are for now, until you get use to
the way that Mandrake is configured. Once you get a feel for it, you can
start to 'tweek' the system.

---------
Note: If this answer resolves your problem, please remember to close this
incident.

 
 
cdspjohn : 28/12/02 05:44 AM : Incident closed
-  



This Incident is closed. It can not be edited anymore. You can create a new one by signing up/logging in your Mandriva Expert account.

  Mandriva  |  Contact  |  Legal  |  Privacy  |  Careers