LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 08-08-2008, 01:08 AM   #1
Sonhi
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Rep: Reputation: 0
Why is access denied to files I haven't made but I'm the owner, I'm the root.


Linux is pissing me off, I've gotten access denied to many files when I'm logged in as the root, I've made my user have access to ALL the groups, nothing works!

The user I'm logged in as was made as the owner when I set up fedora, please help me this is getting in my way. I've spent hours on google trying to find people with my problem but I've had no luck with solving it.
 
Old 08-08-2008, 01:28 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
First, consider the possibility that the system might actually work, and that you misunderstand.

Second, show exact commands and output that demonstrate the problem.
 
Old 08-08-2008, 01:36 AM   #3
Sonhi
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
I began with that mindset, but with all the things I've been through I'm starting to have my doubts.

Anyways, heres what is happening.

[root@roland ~]# mysqladmin -u root password yourrootsqlpassword
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

thats the second command after I installed it.
(first command was)
[root@roland ~]# yum install mysql mysql-devel mysql-server


I didn't edit or change anything. So I went online to find out how to change the password and it tells me to open /var/lib/mysql to close a file before editing. So when I try to go there it tells me I can't view the contents because I don't have permission.
 
Old 08-08-2008, 01:58 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
I'll state it more forcefully: doubt your understanding, not the system.

This has nothing to do with Linux file system permissions. This is mysql telling you that the root user does not have access permissions from the host localhost. You need to correctly configure your mysql permissions table. Mysql does not have a password upon initial installation - you need to configure one.

Here's a howto. Start with step 2b and try to understand what is being done:

http://howtonixnux.blogspot.com/2008...ql-server.html

I make no claim this reference is valid or useful.
 
Old 08-08-2008, 02:21 AM   #5
Sonhi
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Alright, I got down to step 3a and from there I figured out I need to change my database, so from the tutorials I found I managed to get here:

[root@roland ~]# mysql_setpermission --host=localhost
Password for user to connect to MySQL:
######################################################################
## Welcome to the permission setter 1.4 for MySQL.
## made by Luuk de Boer
######################################################################
What would you like to do:
1. Set password for an existing user.
2. Create a database + user privilege for that database
and host combination (user can only do SELECT)
3. Create/append user privilege for an existing database
and host combination (user can only do SELECT)
4. Create/append broader user privileges for an existing
database and host combination
(user can do SELECT,INSERT,UPDATE,DELETE)
5. Create/append quite extended user privileges for an
existing database and host combination (user can do
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
LOCK TABLES,CREATE TEMPORARY TABLES)
6. Create/append full privileges for an existing database
and host combination (user has FULL privilege)
7. Remove all privileges for for an existing database and
host combination.
(user will have all permission fields set to N)
0. exit this program

Make your choice [1,2,3,4,5,6,7,0]:


I chose number 6 and selected mysql database.
Okay we keep it with this ...
The following host(s) will be used: roland.sgameserver.com,localhost.
######################################################################

That was it ... here is an overview of what you gave to me:
The database name : mysql
The username : roland
The host(s) : roland.sgameserver.com,localhost
######################################################################

Are you pretty sure you would like to implement this [yes/no]:

Would this be correct?

Last edited by Sonhi; 08-08-2008 at 02:32 AM.
 
Old 08-08-2008, 02:51 AM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
I cannot confirm if it is correct *for your situation*. This is creating a user, roland, that will be allowed to connect to mysql, from the host system itself,or the full domain name indicated above, and modify the permissions tabling granting full access.

You should then examine the tables in mysql and learn about the user and permissions models.
 
Old 08-08-2008, 03:08 AM   #7
Sonhi
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
HEY! I was looking at a tutorial and they did mysql -u=root
so:
[root@roland ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@roland ~]# mysql -u=root
Welcome to the MySQL monitor. Commands end with ; or \g.


haha, I feel kinda stupid now
is linux this picky?

Last edited by Sonhi; 08-08-2008 at 03:16 AM. Reason: found something
 
Old 08-08-2008, 03:23 AM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
Actually, the DB (ie schema) 'mysql' is basically the data dictionary for mysql itself. Only the mysql root user needs access to that, and usually you wouldn't touch it often.
Its best for normal users to either use the 'test' schema provided, or create a new one eg r_test and grant all privs to roland on that.

As mysql root:

mysql> create database r_test;
mysql> grant all on r_test.* to 'roland'@'localhost';

this assumes roland doesn't need a passwd for that db/schema. See mysql manual:
http://dev.mysql.com/doc/refman/5.0/...ing-users.html
 
Old 08-12-2008, 07:11 AM   #9
Sonhi
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Alright, thanks guys I think I found a solution. Now, I set up a server and I can only access it by using http://localhost

I have a router, and I'm thinking I would need to open a port or something so other people can view the site.
 
  


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
root denied access to a directory dllahr Linux - Software 7 08-17-2006 10:09 AM
ftp : access denied to some files / directories as root XavierX Linux - Software 2 07-18-2006 06:01 AM
Root - Access Denied ! centroid Red Hat 1 05-08-2006 08:16 AM
root denied access? Xstack Linux - Security 10 12-12-2004 05:52 AM
UserDrake access denied problem from root TheCount Mandriva 0 08-24-2004 02:42 PM


All times are GMT -5. The time now is 10:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration