MySQL user permissions?

Place to discuss Fedora and/or Red Hat

MySQL user permissions?

Postby ZiaTioN » Thu Apr 24, 2003 10:37 pm

This somewhat relates to my last post but that one was getting kind of long so here is my new problem. I install MySQL version 3.23.56 fine and it starts up and I am able to login using the anon loghin from localhost.

Now when I try to do anything in the server it errors and says that I do not have permissions?? Why is this. This is a brand new default install. How am I suppose to configure it if I cannot change anything?

I try logging in as root and ZiaTioN and both error and says "Accessed denied for user: '@localhost' (Using password: No)".

Anyone know what I have to do to just do the miniumle config on this?? or to change my permissions or log in as a normal user??

I tried using the "Grant" command but it errored too. I also tried creating another user and it errored. All with the same permissions error!!!!
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Thu Apr 24, 2003 10:53 pm

Anonymous users don't have permission to do squat. You need to create and grant using your mysql root user, or a user that has already been granted appropriate authority. MySQL users != Linux users. Use the "-u username -p" option on your commands to get into MySQL as a different MySQL user. Like I said before, I use webmin for this. Basically this is what I did:

1) Click on "Servers", then "MySQL Database Server".

2) Create Database - Click "create new database" and typed in "forums" for the name of my new database then clicked "create".

3) Create MySQL User and user permissions - Back on the main MySQL page under the "Global Options" I clicked "User Permissions" and added a user called "forums" and gave it a password and next to "Hosts" I put "localhost" and under "permissions" I selected all of them (click the first one, scroll down to the last one and SHIFT+click the last one). See Screenshot

4) Create Database Permissions - Back on the main MySQL page under "Global Options" I clicked on "Database Permissions" where I clicked "create new database permissions" where I selected "forums" for the databse, typed "forums" for the username, typed "localhost" for the Hosts and selected all permissions same as in the previous step. See Screenshot

Now your database and user should be ready to use for your phpBB. Just use localhost for the DSN (database server name) and use the username/password that you created in webmin. You might want to find a good MySQL tutorial somewhere if you want to use it for things beyond your phpBB. I use PostgreSQL and MySQL regularly for PHP/Perl programs that I write. And I just found out that MySQL works great with OpenOffice.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Thu Apr 24, 2003 11:51 pm

Yeah that is what I am saying, I have done your step 1 and 2 numerous times and webmin errors and says that I do not have permisions to create a new data base. Same with creating a new user.

The error I get while trying to create a database through webmin is "Failed to create database: DBI connect failed: Access denied for user '@localhost' to database 'mysql'"

This is what I get for all. it appears it is still trying to do this using the anon user. How do I know what user is the root user to MySQL? It never asked for me to config a user. Or to input a password for any user.

This is why I am lost..
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby ZiaTioN » Fri Apr 25, 2003 12:03 am

I might have found something. When I check my hostname in Redhat it shows "TheGNUage" and when I try to connect through command line or through webmin it still shows my old hostname which was "thenewage.dyndns.org".

How can I find this config data and remove the old server name? I think I cvhanged this name by only using the "hostname" command and using the permanent change option or saomewthing like that. Then I added this inpout to /etc/hosts

I never removed the old input. Where could I find this??
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Fri Apr 25, 2003 12:09 am

When you changed the mysql root password did you also update the Webmin configuration to reflect that change? I'll bet that is your problem. Click "Servers" then "MySQL" then "Module Config" near the top of the page. Set the administrative id and password to root and whatever you set mysql root's password to. It's failing because you are not logged in as a user. If you were it would say "root@localhost" instead of "@localhost".
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Fri Apr 25, 2003 12:26 am

Yeah that is the problem. It will not let me connect through command line even. I really think the 2 different hostnames is confusing it or something.

I tried what you said thoiugh and it does the same thing.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Fri Apr 25, 2003 12:36 am

Well your hostname is actually set in the /etc/sysconfig/network file (HOSTNAME=blah). After changing that you could do a reboot, or restart all of your services (at least network, mysql, and webmin). I don't see how that is effecting it though because it should only care about localhost. You DO have a localhost entry in your /etc/hosts for 127.0.0.1 right?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby ZiaTioN » Fri Apr 25, 2003 1:05 am

Yes I do have a localhost entry in /etc/hosts.

I figured it out though. What was happening was when I installed the rpm for some reason it created a "root" account on the hostname "localhost" and one on the hostname "TheGNUage".

So when I first installed it I would change the root password right away and then try to login with this command.

mysql -u root password "password"

This would error of course because I think when I changed the root password initially it changed it on the root account under the hostname of "TheGNUage" and not localjost but when I tried to connect by default it tried to connect to the root account under localhost.

I of course never tried a blank password for root because I had just changed it so I thought I was in the right hostname root user. Of course I had no way of knowing this until I just un-installed the rpm's again and then reinstalled and instead of changing the root password first thing I left it blank and logged into webmin and was able to get into MySQL this time as root. Then by configing everything i realized that it had created 2 root accounts and realised what was happening.

Thanx again for all your help dude. I know I droned on and on but it really didn't make since but now it does.
ZiaTioN
administrator
administrator
 
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm

Postby Void Main » Fri Apr 25, 2003 1:13 am

I had to go through the same thing so I'm glad you are getting it. Once the lights start popping on it's child's play.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 2 guests

cron