Mysql - mam uzivatele user@% - ale z localhostu se nepripojim
Uz s MySQL delam nejakou dobu, ale dosud jsem asi nepochopil jednu zrejme zakladni vec.
Mam uzivatele user@% ktery ma plna prava na jednu databazi.
- Pri vzdalenem pripojeni, nebo pokud se pripojuju k svemu pocitaci pres IP adresu, tak to funguje.
- Ale pokud se pripojuju na localhost nebo jmeno pocitace, nadava mi, ze pry Access denied for user 'user'@'localhost' (using password YES). Nema snad % znamenat, ze je pripojeni povoleno z libovolneho pocitace?
Resil jsem to tak, ze jsem si vytvoril jeste uzivatele user@localhost, jenze tam je zase problem, ze nemohu editovat ulozene procedury, protoze jejich definer je user@%.
Misto toho, abych udelal nejakou praci, tak resim takoveto nesmyslne kraviny. Jsem zvykly z jinych databazi na jine logictejsi chovani.
EDIT: Zapomnel jsem dodat, ze se jedna o MySQL 5.1.30 a OS OpenSuse 11.1, ale stejne chovani jsem vypozoroval i ve Windows a MySQL 5.1.x a 5.0.x.
Re: Mysql - mam uzivatele user@% - ale z localhostu se nepripojim
http://dev.mysql.com/doc/refman/5.1/...ing-users.html
Citace:
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 5.4.4, “Access Control, Stage 1: Connection Verification”.)
Re: Mysql - mam uzivatele user@% - ale z localhostu se nepripojim
Hmm, diky, precetl jsem si to, nechapu smysl toho, ze mezi % nespada i localhost, vzdyt pisou ze % je any host, localhost je taky host.
Ale jak ted mam odkudkoliv upravovat ulozeny procedury, kdyz je vytvoril user@% a ja jako user@localhost je nemuzu ani otevrit? Sice je muzu pod rootem vsechny vydumpovat a zmenit definera na user@localhost, ale pak je zase nedokazu editovat vzdalene.
Re: Mysql - mam uzivatele user@% - ale z localhostu se nepripojim
Mrkni do manuálu na 'SQL SECURITY INVOKER' ;)