473,395 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Trouble Changing Datadir Location

I'm new to MySQL so hopefully this all makes sense.

I'm running mysql-3.23.58-14 on Fedora Core 3 and everything installs
and comes up correctly using default locations for everything.
However, I installed an 800GB RAID5 array in the server and created a
new file system on it and I attempted to move the datadir location to
the new file system and that's when the problems started.

Basically what I did was this - I shut down mysqld and copied
everything from /var/lib/mysql over to my new filesystem (/data/mysql).
Then I checked the owner of /data/mysql and all subdirectories - its
mysql:mysql just like the original location. I checked to make sure
the permissions were the same as the original location and they are.
Then I edited /etc/my.cnf and changed the line datadir=/data/mysql. I
left everything else in the file as it was. Then I tried to start
mysqld again and got the following message:

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

I checked /var/log/mysqld.log and found:

050331 00:43:17 mysqld started
/usr/libexec/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13)
050331 0:43:17 Aborting

050331 0:43:17 /usr/libexec/mysqld: Shutdown Complete

050331 00:43:17 mysqld ended

I googled the errorcode and found its permission related but I've
double-checked and triple-checked the owner, group and file permissions
on the alternate datadir location and they look like they're
correct...so I'm unsure on how to proceed from here.

If I switch the datadir back to its original location in /etc/my.cnf
everything starts up fine.

Any help you can offer would be greatly appreciated.

Travis

Jul 23 '05 #1
1 3088
This isn't really an answer, but it's something to try:

change to the root user, then do an 'su - mysql'. You are now the
mysql user; try to manually change to the /data/mysql directory. If
that is successful, and you (as the mysql user) can do an 'ls' in that
directory and see the contents, then most likely it's not really a
permissions issue (which would confirm what you already thought).

I have found that moving mysql directories was quite painful in the
past as well, as the data directory variable seems to be stored in
multiple mysql config files. you may want to 'grep -R /var/lib/mysql
*' your mysql installation directory and see if you find other
references that need to be changed. Finally, if all else fails, you
can simlink /var/lib/mysql to /data/mysql (ln -s /data/mysql
/var/lib/mysql).

Good luck!
MAC

tr******@yahoo.com wrote:
I'm new to MySQL so hopefully this all makes sense.

I'm running mysql-3.23.58-14 on Fedora Core 3 and everything installs
and comes up correctly using default locations for everything.
However, I installed an 800GB RAID5 array in the server and created a
new file system on it and I attempted to move the datadir location to
the new file system and that's when the problems started.

Basically what I did was this - I shut down mysqld and copied
everything from /var/lib/mysql over to my new filesystem (/data/mysql). Then I checked the owner of /data/mysql and all subdirectories - its
mysql:mysql just like the original location. I checked to make sure
the permissions were the same as the original location and they are.
Then I edited /etc/my.cnf and changed the line datadir=/data/mysql. I left everything else in the file as it was. Then I tried to start
mysqld again and got the following message:

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

I checked /var/log/mysqld.log and found:

050331 00:43:17 mysqld started
/usr/libexec/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13)
050331 0:43:17 Aborting

050331 0:43:17 /usr/libexec/mysqld: Shutdown Complete

050331 00:43:17 mysqld ended

I googled the errorcode and found its permission related but I've
double-checked and triple-checked the owner, group and file permissions on the alternate datadir location and they look like they're
correct...so I'm unsure on how to proceed from here.

If I switch the datadir back to its original location in /etc/my.cnf
everything starts up fine.

Any help you can offer would be greatly appreciated.

Travis


Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: flubdgub | last post by:
Hi there, I want to do something ridiculously simple and naturally MySQL is presenting me with problems that the manual doesn't even hint at. Platform is Debian Linux 2.4.21 All I want to do...
0
by: Nils Valentin | last post by:
Hello MySQL Fans, This time I am using 4.0.13-max (tar format from www.mysql.com) on Redhat 9. I have an understanding question why would the command SHOW VRAIABLES give me once the real...
0
by: Jean Vaillancourt | last post by:
Hi, I installed MySql with the default settings. But I'd like now to change the place where I keep my data files. I tried changing the DATADIR parameter in /etc/my.cfg but the server won't...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
1
by: laredotornado | last post by:
Hi, How do I change the place where the mysql socket file gets created? I thought it was in the my.cnf file by changing the "socket" property. However, using MySQL 5.0 on my Fedora Core 5 Linux...
1
by: pontarolo | last post by:
Hi, I would like to move my DBs in another directory. I know that I have to change in my.cnf the datadir path .... datadir=/var/lib/mysql -datadir=/user/mysql/databases
9
by: Archanak | last post by:
Hi, I changed the data directory of mysql through my.cnf file. my.cnf has the details. "#" indicates the i have changed accordingly to the main directory. I want to move my tables from...
5
by: g0uki | last post by:
Hi all, i hope you can help, I'm having some trouble getting all the data from a file, well just the date and time entries. I'll be doing operations on the data so would like to store it within...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.