LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 09: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, 09:53 PM   #2
deepika
Member
 
Registered: Jul 2003
Distribution: Redhat
Posts: 88

Rep: Reputation: 15
chmod 660 <filename>
 
Old 07-19-2003, 09: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, 10:01 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
chgrp group file
 
Old 07-19-2003, 10: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-19-2003, 11:12 PM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:43 PM.

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
Open Source Consulting | Domain Registration