Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

$db = mysql_connect("host", "user", "password")

[es] :: MySQL :: $db = mysql_connect("host", "user", "password")

[ Pregleda: 5733 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

mrki
radnik
Sombor

Član broj: 1050
Poruke: 580
*.beg.sezampro.yu

Jabber: mrki@elitesecurity.org
ICQ: 58816584


Profil

icon $db = mysql_connect("host", "user", "password")23.10.2003. u 10:17 - pre 249 meseci
#/usr/bin/mysql
mysql>

Dakel pokrecem mysql samo kao root. To bi trebalo da je tako?

E sad pomocu PHP funkcije pokusavam da ostvarim konekciju:

$db = mysql_connect("host", "user", "password");
odnosno:
$db = mysql_connect("alien", "root", "root_pass");

ali dobijam gresku:

Warning: Host 'Alien.mrksoni.home' is not allowed to connect to this MySQL server in /usr/local/httpd/htdocs/knjiga_gostiju/admin/connect.php on line 2

Warning: MySQL Connection Failed: Host 'Alien.mrksoni.home' is not allowed to connect to this MySQL server in /usr/local/httpd/htdocs/knjiga_gostiju/admin/connect.php on line 2
Could not connect.

Pokusao sam da unesem i user odnosno pass za trenutno aktivnog korisnika, medjutim mysql javlja istu gresku. Iz poruke mi je sasvim jasno sta je problem, medjutim ne znam kako da ga resim?



Nekad sam bio mlad ;)
 
Odgovor na temu

alex
Aleksandar Radulovic
Senior Software Engineer, Spotify
Stockholm, Sweden

Član broj: 71
Poruke: 2194
*.habil.is

Jabber: alex@a13x.info
ICQ: -1
Sajt: www.a13x.info


+1 Profil

icon Re: $db = mysql_connect("host", "user", "password")23.10.2003. u 11:30 - pre 249 meseci
Mrki, na serveru uradi sledece:

Code:

# mysql
> grant all privileges on *.tvojabaza to '[email protected]' identified by 'password' with grant option;
> flush privileges;


Time ces dozvoliti pristup sa tog hosta. Procitaj dokumentaciju od MySQL-a, a narocito obrati paznju na grant opcije.

Alex: My favorite site is http://localhost/
R.J. Oppenheimer: "I am become death, destroyer of worlds" (1945 AD)
tweet.13x ||
linkedin.13x
 
Odgovor na temu

mrki
radnik
Sombor

Član broj: 1050
Poruke: 580
*.beg.sezampro.yu

Jabber: mrki@elitesecurity.org
ICQ: 58816584


Profil

icon Re: $db = mysql_connect("host", "user", "password")23.10.2003. u 14:55 - pre 249 meseci
ma ko ce svaki put procitati ceo manual, za mysql u pdf formatu ima neki 600 strana...
Pogledao sam grant opciju i resio problem, thank's.

Ova sintaksa je generisala neku gresku kod mene, pa sam je malo izmenio pomocu manual-a naravno :

Code:
mysql> grant all privileges on mojabaza.* to 'user'@'localhost' identified by 'password' with grant option;
>flush privileges;

Nekad sam bio mlad ;)
 
Odgovor na temu

alex
Aleksandar Radulovic
Senior Software Engineer, Spotify
Stockholm, Sweden

Član broj: 71
Poruke: 2194
*.habil.is

Jabber: alex@a13x.info
ICQ: -1
Sajt: www.a13x.info


+1 Profil

icon Re: $db = mysql_connect("host", "user", "password")23.10.2003. u 15:05 - pre 249 meseci
Eto, ipak sam te naterao da pogledas dokumentaciju .
Alex: My favorite site is http://localhost/
R.J. Oppenheimer: "I am become death, destroyer of worlds" (1945 AD)
tweet.13x ||
linkedin.13x
 
Odgovor na temu

mrki
radnik
Sombor

Član broj: 1050
Poruke: 580
195.252.80.*

Jabber: mrki@elitesecurity.org
ICQ: 58816584


Profil

icon Re: $db = mysql_connect("host", "user", "password")24.10.2003. u 09:52 - pre 249 meseci
Ma jok, nisi me naterao
samo si mi usmerio paznju...a to ti je brate vrlo korisna stvar
Nekad sam bio mlad ;)
 
Odgovor na temu

[es] :: MySQL :: $db = mysql_connect("host", "user", "password")

[ Pregleda: 5733 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.