Page 1 of 1

Setting up user permissions in mysql

PostPosted: 11. January 2013 23:04
by karefree
I have set up XAMPP in Win7 and hav mysql running but it says I can't change the password for myself (the user) as I don't have permission to do that. What am I doing wrong? I would really appreciate any help as I'm trying to set this up for a university course and don't have a lot of experience in permissions/mysql. Thanks!

Re: Setting up user permissions in mysql

PostPosted: 11. January 2013 23:37
by Altrea
Hi karefree,

A short salutation is an act of politeness. Even if the internet is an virtual area, there is always a human being behind the screen. A polite beginning helps to get polite answers too.

How do you connect to mysql (command line, phpmyadmin, ...)?
Which user do you use to connect?
Which users password do you want to change?
Where do you try to change the password?

best wishes,
Altrea

Re: Setting up user permissions in mysql

PostPosted: 12. January 2013 00:03
by karefree
Sorry for the lack of etiquette, Altrea...and thank you for the reminder...kindness should never be forgotten! :-)

I am connecting through mysql>. I installed XAMPP on my laptop and might not have installed it in the right place or as the administrator?? It is connecting though and I do get some sql commands back from my queries. I'm not sure how I would even log on as admin as I haven't had to do it before...I'm taking a php course and studying how to set up the server through the book "PHP" 3rd edition, Larry Uhlman. I'm trying to follow his instruction: Enter the pathname identified plus "-u username -p" which didnt' work for me..Basically, I'm trying to set up my first username. I have so little knowledge that I'm getting discouraged.. :-( I tried to set the user through this directory: c:\xampp\mysql\bin\myslq and tried to set up password at the same place and got the following message:
Access Denied for user ' ''@'localhost' to database mysql;

Thanks for any help that you can give Altrea!
It is TRULY appreciated!
karefree

Re: Setting up user permissions in mysql

PostPosted: 12. January 2013 01:01
by Altrea
karefree wrote:I am connecting through mysql>.
[...]
I'm trying to follow his instruction: Enter the pathname identified plus "-u username -p" which didnt' work for me

Okay, so you are trying to connect through the mysql command line interface (CLI).
What happens if you try to connect like so?:
Code: Select all
C:\xampp\mysql\bin>mysql --user=root --password


karefree wrote:I installed XAMPP on my laptop and might not have installed it in the right place

If XAMPP is installed in C:\xampp\ that is the correct place :D

karefree wrote:Access Denied for user ' ''@'localhost' to database mysql;

Which simply means, that you don't connect correct. You are trying to create a new username with an anonymous user.
That user dowsn't have the permission to create users. You have to connect with the user root which is simply the mysql administrator user.

best wishes,
Altrea

P.S.: If you don't want to follow the tutorial for the lesson of creating a new user, you can even use phpmyadmin, which is simply a php written GUI. For this you have to start your XAMPP Apache application, open a browser window and request the url http://localhost/phpmyadmin/ you will be automatically logged in as root (as far as you don't change the password for the user root).

Re: Setting up user permissions in mysql

PostPosted: 12. January 2013 03:15
by karefree
Hi Altrea.

Thank you for the info. I did get it all up and working thanks to your help. I greatly appreciate the assistance!
Take care,
karefree