Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-02-2006, 08:16 AM   #1
LQ Newbie
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
MySQL won't change database directory

Our company trying to migrate to mySQL 5.0 and I'm having some problems setting it up on our first new server.

System: 8 GB Ram, Dual-core.
OS: Red Hat Enterprise Linux 4

I was able to get it to start but I'm trying to change the directory the database is stored. I understand this is the datadir value in the my.cnf. This file doesn't exists so I copied the my-huge.cnf file and inserted the following lines at the bottom:


Also do I change all the /var/lib/mysql/ to the new directory or the one value. Only other path in the file was for socket, so I changed that even though I could find the fine it was originally pointing to. When I try to start mysql I get the following message.

[root@Hostname /]# service mysql start
Starting MySQLCouldn't find MySQL manager or server [FAILED]

I copied the /var/lib/mysql director to /sqldir and chown it to mysql user. I tried changing basedir=/sqldir/mysql/, putting the socket path back as it was and commenting it out but continue to get the above error. if I remove my.cnf then mysql starts fine only not using desired database path.

I appreciate any help with this.

Old 10-03-2006, 05:24 PM   #2
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Here is a cheap and dirty trick.....

Move your existing /var/lib/mysql to /sqldir and then replace /var/lib/mysql with a soft link pointing to /sqldir.
Old 10-04-2006, 01:11 PM   #3
LQ Newbie
Registered: Sep 2006
Posts: 3

Original Poster
Rep: Reputation: 0
That works. Thanks alot.

I don't mind dirty tricks in this case.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM
Change database name AMMullan Programming 2 05-13-2004 07:44 AM
MYSQL help - mysql database missing eloviyandhi Linux - Software 1 03-20-2004 09:20 PM
MySQL database directory GATTACA Programming 7 12-06-2003 11:54 PM
MYSQL on Slackware9.0 ./mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13) Litn Linux - Software 2 09-02-2003 09:00 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration