LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2003, 05:47 PM   #1
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Rep: Reputation: 15
Mysql User grant problems


Hey

I just got Mysql up and working (yay!)

heres some background info:

Slackware 9
Mysql 4.3.5

I guess i created a user called 'mysql' with a blank password.

IN PHP, when i try to select a db with this command line:

mysql_select_db('uber');

it returns with this error, which i receive with this function mysql_error():

Access denied for user: '@localhost' to database 'uber'

Now, what does this mean? and what do i have to do?

Thanks a lot..
 
Old 07-27-2003, 09:53 PM   #2
dkaplowitz
Member
 
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253

Rep: Reputation: 31
Are you specifying a username in the php script? You'll need to make a reference to the username and pass in the script ....or in a global file that has all the database parameters defined in it (which is more secure than putting the username/pass in each individual script.

It seems the script is trying to log into MySQL without any credentials other than the machine's identity.

There is a ton of good documentation on php.net and mysql.com about how to properly access your db.

Good luck.
 
Old 07-27-2003, 11:25 PM   #3
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Original Poster
Rep: Reputation: 15
Yes, i am providing the connection parameters..

mysql_connect('localhost','mysql','password');

that doesn't produce an error, i have it setup so if the login doesnt work, it'll give me a message, But im only getting a message when i select a database with this line

mysql_select_db('uber');

Any ideas?
 
Old 07-28-2003, 03:16 AM   #4
piti
LQ Newbie
 
Registered: Jul 2003
Distribution: mdk, rh
Posts: 11

Rep: Reputation: 0
what u need is to grant the mysql user rights to access the uber database
grant all on uber.* to mysql@localhost
 
Old 07-29-2003, 04:55 PM   #5
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Original Poster
Rep: Reputation: 15
When I type in the following command that u gave me:
grant all on uber.* to mysql@localhost

I get the error that grant: command not found

Are you sure thats the right command?
 
Old 07-29-2003, 05:49 PM   #6
ohlssonvox
LQ Newbie
 
Registered: Jul 2003
Location: tokyo
Distribution: cat in the REDHAT
Posts: 9

Rep: Reputation: 0
I always use webmin to setup MySQL databases. It is quite a bit easier: http://www.webmin.com
 
Old 07-29-2003, 06:05 PM   #7
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Have you logged into mysql before you try the grant command?

typed in

mysql

first

don't forget a ; at the end

Wondering if the mysql user you originally create was a system user for mysql to run as nah forget that you logged in as them, duh!!

Last edited by Looking_Lost; 07-29-2003 at 06:09 PM.
 
Old 07-30-2003, 12:33 AM   #8
ubers0ldat
Member
 
Registered: Jul 2003
Posts: 33

Original Poster
Rep: Reputation: 15
Well, thanks for the replies, but i read the manual and i knew it was an issue with user permissions. And i was just havin trouble with it. But ir ead the manual thoroughly and heres what i came up with :

http://www.mysql.com/doc/en/Adding_users.html

mysql> GRANT ALL PRIVILEGES ON *.* TO username@localhost
-> IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

make sure u login to mysql first, and can issue commands to the mysql program (yes it may be simple to u gurus, but to us newbies it's a pretty difficult task )
 
  


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
Grant Privileges - MySQL Jannyno Linux - General 2 06-23-2012 02:00 AM
grant user access to /fat-c & copying users' preferences to another user n0x Linux - Newbie 1 07-04-2004 12:04 AM
Why mysql GRANT does not work? robertoneto123 Linux - Software 2 01-23-2004 07:33 AM
mysql grant issues Robin01 Linux - Newbie 1 10-29-2003 09:56 PM
MYSQL GRANT etc etc markopolox Programming 8 09-23-2003 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:29 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
Open Source Consulting | Domain Registration