473,670 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3107
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
3945
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 is change the datadir in /etc/mysql/my.cnf from /var/lib/mysql to /DB. I attempted this as follows:
0
2739
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 output and once the symlink ouput for directory names ? Sample (datadir and basedir) :
0
1495
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 start. Is there any way to change only the data directory from /var/lib/mysql to /otherplace/mysql and leave everything else in it's place? Thanks
7
2955
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 already formatted as "Shopping" ---Bold "for" -----Regular Now I want to underline whole text by preserving old style i.e. Bold and
3
4996
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 : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
1
4051
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 system, when I do this and restart, attempting to connect to MySQL through PHP gives me this error Warning: mysql_connect() : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in
1
23439
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
7340
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 /var/lib/mysql to /home/db.
5
1398
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 variables. My script's output is looking a bit strange... The file is sent from a server so changing it will be difficult. Nearly all of the data are in quotes except the date and time. First line of the file are the headings, then the data:...
0
8814
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8660
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.