LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2003, 10:48 PM   #1
taran
Member
 
Registered: Jul 2003
Distribution: Red Hat
Posts: 35

Rep: Reputation: 15
Chmod


I mistakenly changed the permissions on some mysql databases. I need to set the permissions back to

-rw-rw----

with the user and group of mysql.

How do I do that?
 
Old 07-19-2003, 10:53 PM   #2
deepika
Member
 
Registered: Jul 2003
Distribution: Redhat
Posts: 88

Rep: Reputation: 15
chmod 660 <filename>
 
Old 07-19-2003, 10:56 PM   #3
taran
Member
 
Registered: Jul 2003
Distribution: Red Hat
Posts: 35

Original Poster
Rep: Reputation: 15
that would set it to -rw-rw----

but how do i set the user and group back to mysql instead of root?
 
Old 07-19-2003, 11:01 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
chgrp group file
 
Old 07-19-2003, 11:53 PM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
To set the owner only:
chown owner file

To set the owner and the group at the same time:
chown owner:group file

To set the group only:
chgrp group file
 
Old 07-20-2003, 12:12 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
And if you've got MANY, or an entire directory with subdirectories full of files, remember to use the recursive key:
-R
So:
chown -R owner:group file



Cool
 
  


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 use Chmod Centinul Linux - Newbie 8 06-30-2005 11:44 AM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 09:53 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM
Chmod gibbylinks Linux - Newbie 1 10-23-2003 12:17 PM
chmod u+s csDraco_ Slackware 6 04-22-2003 09:44 AM


All times are GMT -5. The time now is 07:09 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