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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-27-2003, 05:47 PM
|
#1
|
Member
Registered: Jul 2003
Posts: 33
Rep:
|
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..
|
|
|
07-27-2003, 09:53 PM
|
#2
|
Member
Registered: Oct 2002
Location: Havertown PA
Distribution: Ubuntu/RHEL/Fedora
Posts: 253
Rep:
|
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.
|
|
|
07-27-2003, 11:25 PM
|
#3
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
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?
|
|
|
07-28-2003, 03:16 AM
|
#4
|
LQ Newbie
Registered: Jul 2003
Distribution: mdk, rh
Posts: 11
Rep:
|
what u need is to grant the mysql user rights to access the uber database
grant all on uber.* to mysql@localhost
|
|
|
07-29-2003, 04:55 PM
|
#5
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
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?
|
|
|
07-29-2003, 05:49 PM
|
#6
|
LQ Newbie
Registered: Jul 2003
Location: tokyo
Distribution: cat in the REDHAT
Posts: 9
Rep:
|
I always use webmin to setup MySQL databases. It is quite a bit easier: http://www.webmin.com
|
|
|
07-29-2003, 06:05 PM
|
#7
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
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.
|
|
|
07-30-2003, 12:33 AM
|
#8
|
Member
Registered: Jul 2003
Posts: 33
Original Poster
Rep:
|
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  )
|
|
|
All times are GMT -5. The time now is 09:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|