LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot login a user on phpmyadmin (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-login-a-user-on-phpmyadmin-4175468386/)

giobaxx 07-03-2013 03:23 PM

cannot login a user on phpmyadmin
 
Hi,....firs sorry for my english..

I'm tryng to install and configure LAMP solution on my UBUNTU. i have installed all the software needed, and i want to create some user in phpmyadmin to admnistrate his own database.

i insert a username( for example alex) a passoword(es: 12345) and at the voice "host" i select from the combobox "ANY HOST". I though that the user alex can log-in on phpmyadmin from every host.

But when i tried to login with username alex i receive the error "#1045 Cannot log in to the MySQL server"...that error from any host i try to connect(local or not).

If I choose "local" instead of "any host" i can login.....from any host(local or remote).....that make me a bit confused...

someome...can help me to undestand how it works?......what it means to select "any host" instead local?

in a professional enviroment what a have to choose? local....any host or other?

Kustom42 07-03-2013 03:28 PM

I think you need to have an understanding of the mysql authentication table and how it works as this isnt a PHPMyAdmin thing its a mysqld login thing.

http://dev.mysql.com/doc/refman/5.1/...ing-users.html < Discusses the basics of adding users, about 3 or 4 paragrahs down it discusses the host portion of the user permissions
http://dev.mysql.com/doc/refman/5.1/...on-access.html < Discusses in detail how the user access works with example dumps from the mysql table.

giobaxx 07-03-2013 03:34 PM

tanks.....try to read the the documentation.......

Kustom42 07-03-2013 03:38 PM

Yes try and think about where you are actually initiating the connection from in these cases. PHPMyAdmin initiates the connection from whatever server it is running on. So if you have mysql installed on server A and PHPMyAdmin on server A then they are both on the same host and localhost or server A would be the hostname connecting from. If you had PHPMyAdmin installed on Server B you would have to specify that host in the mysql permissions. I.e

Code:

GRANT ALL PRIVILEGES ON *.* TO 'username'@'server B'

giobaxx 07-03-2013 05:21 PM

I had and sure i have even some "casino" in my mynd....

I thought with localhost i can access (to phpmyadmin) with that specif user only if i sign-in in the host where is installed phpmyadin, and with 'any' i can get access from any other host all over internet...


from what i undertand....is right to say that if want that the user 'alex' could connect from any host i have to create two account for 'alex', one with host as 'localost' and one with 'any' setting the wildcard(%)?



.....

Kustom42 07-04-2013 01:55 AM

Quote:

Originally Posted by giobaxx (Post 4983752)
is right to say that if want that the user 'alex' could connect from any host i have to create two account for 'alex', one with host as 'localost' and one with 'any' setting the wildcard(%)?

No you will only have one match for each user. So it will go through the table and find the first match of either the username "alex" or the hostname. If you wanted to be able to connect to MySQL from anywhere, including localhost, for the alex user add them with the '%' for the hostname.

giobaxx 07-04-2013 03:16 AM

.....try to explain what i did, i spoke about have access to phpmyadmin;

i have create this user on phpmyadmin

username:alex
host:any
password:12345

if i try to login from the webinterface of localhost/phpmyadmin i receive error 1045

i made the same configuration on a remote computer on internet(virtual server on linode) i connect for example to 75.21.84.85/phpmyadmin i received the same error ----> no access in local or remote

i have tried with other user

username:joe
host:local
password:12345

with that user i can have access locally with localhost/phpmyadmin and remotely 75.21.84.85/phpmyadmin --->so with local i have access locally and all over

so with local i tell you to phpmyadmin that mysql is on the same computer of phpmyadmin?..or what?


All times are GMT -5. The time now is 12:59 PM.