LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-09-2006, 05:29 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,145

Rep: Reputation: 47
changing mysql data folder


My data drive is only 10GB and my mysql data folder is getting rather big. So I want to move the /var/lib/mysql folder to /data2/mysql. So I did, no problem, everything copied. Then I found that /etc/my.cnf has the datadir parameter, so I changed it to reflect to the new path.

But when I try to start mysql, I get this (and there's nothing in the syslog)

Code:
borg:~# ser mysql start
Starting MySQL database server: mysqld...failed.
        Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
borg:~#
If I rename the /var/lib/mysql folder back it works, so for some reason, even after the changes I made in my.cnf, it's not taking affect.

Is there perhaps something else I need to edit as well?
 
Old 02-09-2006, 05:55 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,608

Rep: Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802
Did you check the permissions in the new directory, i.e. make sure that it's rw for the user under which priviledges mysqld is running. Else you can create a symlink to see if it helps:
Code:
ln -s /data2/mysql /var/lib/mysql
 
Old 02-09-2006, 06:25 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,145

Original Poster
Rep: Reputation: 47
Funny as I had the exact idea of creating a symlink, and that did not work either. But it was in fact a permission issue as they were owned by root and not mysql and only had rwx for user. So I changed the owner to mysql. Thanks for that tip as I did not even think of checking that.
 
Old 02-09-2006, 06:58 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,608

Rep: Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802Reputation: 1802
Glad that I've helped

Cheers
 
  


Reply


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
how to determine the folder contain data or not izza_azhar Programming 2 05-24-2005 08:38 PM
Changing Folder View Xios Linux - General 1 02-06-2005 02:35 AM
Where is the data folder for webserver? helpme0904 Linux - General 1 11-03-2004 09:49 AM
Don't Delete This Message -- Folder Internal Data ooorah Linux - Security 2 10-18-2004 10:14 PM
changing mail folder polis Linux - Newbie 0 05-18-2004 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:30 AM.

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