Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

[MySQL] Probleem: gebruiker met password werkt niet

Pagina: 1
Acties:

  • lappro
  • Registratie: December 2010
  • Laatst online: 31-07 14:52
Ik wil een gebruiker toevoegen op mijn MySQL server. Of ik ze nou rechten geef op een bestaande database, nieuwe database of alle rechten ik kom elke keer hetzelfde probleem tegen:
Als ik een nieuwe gebruiker aan maak met wachtwoord en vervolgens met die nieuw aangemaakte gebruiker probeer in te loggen op MySQL via SSH dan krijg ik de foutmelding:
ERROR 1045 (28000): Access denied for user 'test1'@'localhost' (using password: YES)
en op phpMyAdmin:
#1045 Kan niet aanmelden op de MySQL-server

Mijn configuratie:
MySQL: 5.5.28-1 (Debian)
Server: raspberry pi B 2nd rev.
OS: Raspbian "Wheezy" (gemodde debian)
phpMyAdmin versie 3.5.4 en 3.5.5 (beide hebben zelfde probleem).

Er gaat denk ik dus iets fout met mysql gezien de problemen op phpmyadmin als via SSH gelijk zijn.
De gebruikers heb ik gemaakt of met phpmyadmin of via SSH met:
MySQL:
1
2
3
CREATE USER 'test1'@'%' IDENTIFIED BY 'asdfasdf';
GRANT USAGE ON *.* TO 'test1'@'%' IDENTIFIED BY 'asdfasdf';
GRANT ALL PRIVILEGES ON `database1`.* TO 'test1'@'%';


Dit is niet de eerste keer dat ik hier last van heb maar ik weet niet meer hoe ik het toen opgelost heb en wat ik uberhaupt fout doe. Iemand die mij hiermee kan helpen? :)

  • Johnny
  • Registratie: December 2001
  • Laatst online: 22-11 16:10

Johnny

ondergewaardeerde internetguru

Je probeert in te loggen via SSH, maar hebben je gebruikers niet (standaard) de instelling dat ze alleen vanaf localhost mogen verbinden?

Aan de inhoud van de bovenstaande tekst kunnen geen rechten worden ontleend, tenzij dit expliciet in dit bericht is verwoord.


  • lappro
  • Registratie: December 2010
  • Laatst online: 31-07 14:52
is ssh niet vanaf localhost?
en bij create user heb ik express @'%' zodat ze als het goed is vanaf alle machines mogen verbinden, of daar moet al wat fout gaan?

  • Pizzalucht
  • Registratie: Januari 2011
  • Laatst online: 22:08

Pizzalucht

Snotneus.

Probeer het eens met @'localhost'

  • lappro
  • Registratie: December 2010
  • Laatst online: 31-07 14:52
ah dat werkt wel inderdaad! :D
Maar hoe zou ik dan toegang vanaf alle machines toe kunnen staan?

  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
lappro schreef op woensdag 16 januari 2013 @ 22:17:

Maar hoe zou ik dan toegang vanaf alle machines toe kunnen staan?
Doe eens gek en lees de documentatie eens of google eens?

You can specify wildcards in the host name. For example, user_name@'%.example.com' applies to user_name for any host in the example.com domain, and user_name@'192.168.1.%' applies to user_name for any host in the 192.168.1 class C subnet.

The simple form user_name is a synonym for user_name@'%'.

[ Voor 38% gewijzigd door RobIII op 16-01-2013 22:48 ]

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


  • lappro
  • Registratie: December 2010
  • Laatst online: 31-07 14:52
daar was het niet te vinden maar heb wel ergens gevonden hoe de toegang vanaf alle machines zou moeten werken http://stackoverflow.com/...-remote-connections-mysql

  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 22:23

Creepy

Tactical Espionage Splatterer

Zie http://dev.mysql.com/doc/refman/5.1/en/adding-users.html, gelijk gelinkt vanaf de SO post die je zelf linkt. Het staat wel degelijk gewoon in de manual:
Two of the accounts have a user name of monty and a password of some_pass. Both accounts are superuser accounts with full privileges to do anything. The 'monty'@'localhost' account can be used only when connecting from the local host. The 'monty'@'%' account uses the '%' wildcard for the host part, so it can be used to connect from any host.

It is necessary to have both accounts for monty to be able to connect from anywhere as monty. Without the localhost account, the anonymous-user account for localhost that is created by mysql_install_db would take precedence when monty connects from the local host. As a result, monty would be treated as an anonymous user. The reason for this is that the anonymous-user account has a more specific Host column value than the 'monty'@'%' account and thus comes earlier in the user table sort order. (user table sorting is discussed in Section 6.2.4, “Access Control, Stage 1: Connection Verification”.)

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney

Pagina: 1