[Tuxaloosa] install mysql in non-default location

E Hanson leprkhn at gmail.com
Tue Nov 18 22:33:45 UTC 2008


i would up looking at /etc/shadow to find out that it was user mysql. 
then i looked at my.cnf and there it was... staring at me all this time: 
user=mysql.
sadly chown -hR mysql:mysql /mnt/raid/* didn't get it started, though it 
did get rid of the permissions error. i'm still getting an error that says:
error: 'Can't connect to local MySQL server through socket 
'/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: 
'/var/run/mysqld/mysqld.sock' exists!

i am going to try to change the socket variable in my.cnf to match the 
location of the other changed values (/mnt/raid/mysql/orig/dir/structure).
wish me luck.

Cameron Purvis wrote:
> I believe you can detect your mysql userid with a 'ps -aux | grep
> mysql'  - chances are it's 'mysql' or 'mysqld'.
>
> The chmod sounds promising - maybe tar up the stuff with permissions
> preserved before you do it :)
>
> On Tue, Nov 18, 2008 at 1:09 PM, E Hanson <leprkhn at gmail.com> wrote:
>   
>> ok... it looks like i've managed to botch things a bit. when i
>> /etc/init.d/mysql start
>> i get a failed message.
>> /var/log/syslog says:
>> Nov 18 11:05:17 inventory mysqld_safe[4367]: started
>> Nov 18 11:05:17 inventory mysqld[4370]: 081118 11:05:17  InnoDB: Operating
>> system error number 13 in a file operation.
>> Nov 18 11:05:17 inventory mysqld[4370]: InnoDB: The error means mysqld does
>> not have the access rights to
>> Nov 18 11:05:17 inventory mysqld[4370]: InnoDB: the directory.
>> Nov 18 11:05:17 inventory mysqld[4370]: InnoDB: File name ./ibdata1
>> Nov 18 11:05:17 inventory mysqld[4370]: InnoDB: File operation call:
>> 'create'.
>> Nov 18 11:05:17 inventory mysqld[4370]: InnoDB: Cannot continue operation.
>> Nov 18 11:05:17 inventory mysqld_safe[4376]: ended
>> Nov 18 11:05:32 inventory /etc/init.d/mysql[4511]: 0 processes alive and
>> '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
>> Nov 18 11:05:32 inventory /etc/init.d/mysql[4511]: ^G/usr/bin/mysqladmin:
>> connect to server at 'localhost' failed
>> Nov 18 11:05:32 inventory /etc/init.d/mysql[4511]: error: 'Can't connect to
>> local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
>> Nov 18 11:05:32 inventory /etc/init.d/mysql[4511]: Check that mysqld is
>> running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
>> Nov 18 11:05:32 inventory /etc/init.d/mysql[4511]:
>> Nov 18 11:17:01 inventory /USR/SBIN/CRON[4518]: (root) CMD (   cd / &&
>> run-parts --report /etc/cron.hourly)
>> Nov 18 11:45:48 inventory -- MARK --
>> Nov 18 12:05:48 inventory -- MARK --
>> Nov 18 12:16:12 inventory mysqld_safe[4588]: started
>> Nov 18 12:16:12 inventory mysqld[4591]: 081118 12:16:12  InnoDB: Operating
>> system error number 13 in a file operation.
>> Nov 18 12:16:12 inventory mysqld[4591]: InnoDB: The error means mysqld does
>> not have the access rights to
>> Nov 18 12:16:12 inventory mysqld[4591]: InnoDB: the directory.
>> Nov 18 12:16:12 inventory mysqld[4591]: InnoDB: File name ./ibdata1
>> Nov 18 12:16:12 inventory mysqld[4591]: InnoDB: File operation call:
>> 'create'.
>> Nov 18 12:16:12 inventory mysqld[4591]: InnoDB: Cannot continue operation.
>> Nov 18 12:16:12 inventory mysqld_safe[4597]: ended
>> Nov 18 12:16:27 inventory /etc/init.d/mysql[4732]: 0 processes alive and
>> '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
>> Nov 18 12:16:27 inventory /etc/init.d/mysql[4732]: ^G/usr/bin/mysqladmin:
>> connect to server at 'localhost' failed
>> Nov 18 12:16:27 inventory /etc/init.d/mysql[4732]: error: 'Can't connect to
>> local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
>> Nov 18 12:16:27 inventory /etc/init.d/mysql[4732]: Check that mysqld is
>> running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
>>
>> so i assume that i need to change permissions on the new dirs and their
>> contents.
>> is the mysql user just mysql? is there a group mysql?
>> should i #chown mysql:mysql new/dirs/ ?
>> is that a little broad sweeping?
>>
>> thanks
>> e hanson
>>
>> Mark Greene wrote:
>>     
>>> Interesting question. I never thought about but I'm sure I will need this
>>> answer in the future. Its looking like you need to simply edit your
>>> 'my.conf' file for mysql, which is typically located in the root of /etc.
>>> Change the path of the following:
>>> pid-file=
>>> datadir=
>>> basedir=
>>>
>>> There you go. If you already have this in production simply copy
>>> everything from the original paths into the new paths. I would use rsync -a
>>> to preserve file attributes.
>>> Restart mysql when you're done of course.
>>> ------Original Message------
>>> From: E Hanson
>>> Sender: tuxaloosa-bounces at tuxaloosa.org
>>> To: Tuscaloosa Linux Users Group
>>> ReplyTo: Tuscaloosa Linux Users Group
>>> Sent: Nov 17, 2008 4:21 PM
>>> Subject: [Tuxaloosa] install mysql in non-default location
>>>
>>> i'm setting up vtigerCRM on Debian Etch.
>>> the box has an old RAID card in it that i have 2x80G IDE-100 in raid1 set
>>> up with dmraid.
>>> OS is running on a separate 40G HD.
>>> for the purpose of data redundancy i want the database running (or
>>> stored?) in the array.
>>> so... how do i set up mysql to do this?
>>>
>>> is this really what i want?
>>> RAID is /dev/dm-0 mounted at /mnt/raid
>>> i've never done anything like this before, so any input is very welcome.
>>>
>>> erik hanson
>>> _______________________________________________
>>> TUXaloosa mailing list
>>> TUXaloosa at tuxaloosa.org
>>> http://tuxaloosa.org/mailman/listinfo/tuxaloosa
>>>
>>> _______________________________________________
>>> TUXaloosa mailing list
>>> TUXaloosa at tuxaloosa.org
>>> http://tuxaloosa.org/mailman/listinfo/tuxaloosa
>>>
>>>
>>>       
>> _______________________________________________
>> TUXaloosa mailing list
>> TUXaloosa at tuxaloosa.org
>> http://tuxaloosa.org/mailman/listinfo/tuxaloosa
>>
>>     
> _______________________________________________
> TUXaloosa mailing list
> TUXaloosa at tuxaloosa.org
> http://tuxaloosa.org/mailman/listinfo/tuxaloosa
>
>   



More information about the TUXaloosa mailing list