Infants Posted February 6, 2013 Report Share Posted February 6, 2013 Uzreiz teikšu, neesmu citur meklējis atbildi. PHP pie MySQL konektējas, ja norāda '127.0.0.1:3306', bet nē, ja norāda 'localhost:3306'. It kā nav nekāda problēma, bet nevaru saprast kāpēc tā ir atgadījies. Varbūt kāds gudrs cilvēks uzreiz zin, kur meklēt problēmu? Quote Link to comment Share on other sites More sharing options...
F3llony Posted February 6, 2013 Report Share Posted February 6, 2013 Nekonektējas jeb nevar ielogoties? Ja pirmais, tad mysql lietotājos tavs hosts ir norādīts 127.0.0.1 kas mysql izpratnē nav gluži tas pats, kas localhost. Quote Link to comment Share on other sites More sharing options...
Infants Posted February 6, 2013 Author Report Share Posted February 6, 2013 (edited) Nekonektējas jeb nevar ielogoties? Ja pirmais, tad mysql lietotājos tavs hosts ir norādīts 127.0.0.1 kas mysql izpratnē nav gluži tas pats, kas localhost. Neatrod datubāzi mysql_connect(). Saka, ka tāda neeksistē. Vienmēr, visur ir strādājis 'localhost', tagad nē. hosts failā it kā ir rakstīts 127.0.0.1 localhost.localdomain localhost Hmm, atklājums. Izrādās, ja norāda nevis 'localhost', bet 'localhost:3306' - strādā. Kaut kur php nav norādīts defaultais ports? Kāpēc tad uz 127.0.0.1 strādā bez porta? Vēl labāk. mysqli_connect slēdzās pie localhost:3306 un 127.0.0.1 , bet mysql_connect - tikai pie 127.0.0.1 Edited February 6, 2013 by Infants Quote Link to comment Share on other sites More sharing options...
blackhalt Posted February 6, 2013 Report Share Posted February 6, 2013 (edited) A tur rakstīts: http://dev.mysql.com/doc/refman/5.0/en/connecting.html un te: http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html Edited February 6, 2013 by blackhalt Quote Link to comment Share on other sites More sharing options...
F3llony Posted February 6, 2013 Report Share Posted February 6, 2013 Neizmanto mysql_connect. Tas ir atmests 5.3 un tiks dzēsts no nākotnes versijām. Quote Link to comment Share on other sites More sharing options...
Infants Posted February 6, 2013 Author Report Share Posted February 6, 2013 A tur rakstīts: http://dev.mysql.com/doc/refman/5.0/en/connecting.html un te: http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html @blackhalt Pareizi saprotu, ka manā gadījumā jāturpina lietot 127.0.0.1 un jāaizmirst par šo jautājumu? Quote Link to comment Share on other sites More sharing options...
aaxc Posted February 6, 2013 Report Share Posted February 6, 2013 Uzreiz teikšu, neesmu citur meklējis atbildi. Pēc šāda teksta vien uzreiz gribas šo diskusiju slēgt ... Quote Link to comment Share on other sites More sharing options...
blackhalt Posted February 6, 2013 Report Share Posted February 6, 2013 @blackhalt Pareizi saprotu, ka manā gadījumā jāturpina lietot 127.0.0.1 un jāaizmirst par šo jautājumu? Nezinu, man nav Windows. Man my.cnf ir kaut kā tā: [client] port = 3306 socket = /var/run/mysqld/mysqld.sock .... bind-address = 127.0.0.1 Quote Link to comment Share on other sites More sharing options...
Infants Posted February 6, 2013 Author Report Share Posted February 6, 2013 Nezinu, man nav Windows. Man my.cnf ir kaut kā tā: [client] port = 3306 socket = /var/run/mysqld/mysqld.sock .... bind-address = 127.0.0.1 Tas nav windows. Tas ir Centos6 uz VPS. Quote Link to comment Share on other sites More sharing options...
gurudev Posted May 2, 2013 Report Share Posted May 2, 2013 Ja uz Windas, iecheko hosts failu, ja uz kāda no Unixiem, paskaties /etc/hosts failu. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.