473,396 Members | 1,755 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,396 software developers and data experts.

changing data directory

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.

I changed the permission to:-
sudo chown -R mysql:mysql /home/db/*
Expand|Select|Wrap|Line Numbers
  1. [mysqld]
  2.  
  3. datadir=/var/lib/mysql
  4. #datadir=/home/db
  5.  
  6. socket=/var/lib/mysql/mysql.sock
  7.  
  8. #socket=/home/db/mysql/mysql.sock
  9. set-variable=max_allowed_packet=16M
  10.  
  11.  
  12. [mysql.server]
  13. user=mysql
  14.  
  15. basedir=/var/lib
  16. #basedir=/home/db
  17.  
  18. [safe_mysqld]
  19.  
  20. err-log=/var/log/mysqld.log
  21. pid-file=/var/run/mysqld/mysqld.pid
  22.  
  23. #err-log=/home/log/mysqld.log
  24. #pid-file=/home/run/mysqld/mysqld.pid
  25.  
But still it is giving an error:-

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I don't what to do?

pls help!!

with regards
Archana
Sep 17 '07 #1
9 7320
r035198x
13,262 8TB
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.

I changed the permission to:-
sudo chown -R mysql:mysql /home/db/*

[mysqld]

datadir=/var/lib/mysql
#datadir=/home/db

socket=/var/lib/mysql/mysql.sock

#socket=/home/db/mysql/mysql.sock
set-variable=max_allowed_packet=16M


[mysql.server]
user=mysql

basedir=/var/lib
#basedir=/home/db

[safe_mysqld]

err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

#err-log=/home/log/mysqld.log
#pid-file=/home/run/mysqld/mysqld.pid


But still it is giving an error:-

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I don't what to do?

pls help!!

with regards
Archana
Is the mysql.sock file in that folder?
Sep 17 '07 #2
Is the mysql.sock file in that folder?

i can't copy mysql.sock file
Sep 17 '07 #3
r035198x
13,262 8TB
i can't copy mysql.sock file
Why not?
Sep 17 '07 #4
pbmods
5,821 Expert 4TB
Heya, Archanak.

Is mysqld running?
Sep 17 '07 #5
Heya, Archanak.

Is mysqld running?

Hi,

ya if i give the original datadir then it runs otherwise no.
Sep 18 '07 #6
pbmods
5,821 Expert 4TB
Heya, Archanak.

I assume that you are shutting down mysqld and relaunching it between my.cnf revisions?
Sep 18 '07 #7
Hi everyone... I'm configuring a simple master-slave replication and it's not that hard if you do it in linux, since it's unix I thought it was the same deal in MAC OS X 10.4...but nope. In linux u have to modify the /etc/mysql/my.cnf for the master but there is no such folder as /etc/mysql in Mac, so which file should I modify? many many thanx...
Nov 18 '07 #8
pbmods
5,821 Expert 4TB
Heya, JustChecking. Welcome to TSDN!

It depends on the configuration options when the software was compiled.

Try /etc/my.cnf
Nov 18 '07 #9
Hi!

You must change the mysql user's home dir to new one in /etc/passwd file (because it run chrooted)

Gy.
Dec 3 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steven Buroff | last post by:
Is there any way to get MySQL to create the directory for a new database in a specified directory instead of its "data" directory?
2
by: MENTAT | last post by:
Hi, I am trying to create an installer for my web application. So I added a web setup project to my solution (I am using VS.NET 2003). Been playing around with it since then and it basically...
1
by: trt08010 | last post by:
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,...
3
by: Alur | last post by:
Changing the current directory with the help of dialog window(MFC app) We can change directory with the help of the following code: CFileDialog m_ldFile(TRUE);...
2
by: Grzegorz Kaczor | last post by:
Hello, I have an ASP.NET application in my website in virtual folder A. This folder contains the application itself. I also have a data virtual directory B which contains data that can be seen...
9
by: gopi | last post by:
when installing db2, it only asks for installation directory and does not ask where it is going to store data files. how can i change the default directory after installation.
9
by: silverburgh.meryl | last post by:
i am trying to use python to walk thru each subdirectory from a top directory. Here is my script: savedPagesDirectory = "/home/meryl/saved_pages/data" dir=open(savedPagesDirectory, 'r') ...
4
by: Acrobatic | last post by:
I'm having troubles uploading an image and getting data from getimagesize(). When I upload a file with the name "20050914_loRes_XLH1.jpg", and do a getimagesize on it, it returns no info (null...
3
by: tedpottel | last post by:
Hi, I'm trying to write a ftp in python to send files to my webserverr. Curtly I will change the directory to the folder name, down load the file, then do a chnag dir ..\ to go back to the root...
11
by: =?Utf-8?B?UGF1bA==?= | last post by:
I did a google search but could find what I was looking for. I am creating a temporary folder and placing files in it with a web application. The temporary folder name needs to be changed...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.