KillerBean Posted October 19, 2006 Report Share Posted October 19, 2006 Prebleema sekojosha... uz viena servera viss gaaja ok... bet uz cita uzmet: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in *Te faila links*.php on line 7 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) kods pats ir: <? $dbhost = "localhost"; $dbusername = "te_ir_username"; $dbpassword = "te_ir_password"; $dbdatabase = "te_ir_DB"; mysql_connect($dbhost,$dbusername,$dbpassword) or die(mysql_error()); mysql_select_db($dbdatabase) or die(mysql_error()); ?> Kapeec vinjam kkas tajos sock'os nepatiik?? Link to comment Share on other sites More sharing options...
andrisp Posted October 19, 2006 Report Share Posted October 19, 2006 Katrā ziņā tā ir servera (konfigurācijas) probēma. Gūglēt pēc errora mēģināji ? Link to comment Share on other sites More sharing options...
Kristabs Posted October 19, 2006 Report Share Posted October 19, 2006 PHP kļūda tā nav. Mysql galā gan. Saki servera adminam vai cīnies pats. Apskati http://php.lv/f/index.php?showtopic=5406&hl=sock Link to comment Share on other sites More sharing options...
Delfins Posted October 20, 2006 Report Share Posted October 20, 2006 tas servers vai nu nav piestartēts, vai PHP līki sakompilēts Link to comment Share on other sites More sharing options...
v3rb0 Posted October 20, 2006 Report Share Posted October 20, 2006 ja vari, tad pasties vai myslq savu socketu ielicis iekš /tmp? nav zem kāda /var/run? Link to comment Share on other sites More sharing options...
Roze Posted October 20, 2006 Report Share Posted October 20, 2006 Šai problēmai ir šāds cēlonis - php ir nokompilēts lai meklētu MySQL socket failu zem /tmp bet MySQL ir izveidojis to kaut kur citur (parasti zem /var/lib/mysql/ ... ) Ir divi risinājumi: 1. Atrast kur MySQL patiesi ir izveitojis to savu mysql.sock failu un pamainīt to: a) to var darīt MySQL galā my.cnf norādot [mysqld] socket=/tmp/mysql.sock b) php.ini / vai ini_set nomainīt uz pašreizējo: mysql.default_socket 2. Vienkāršāks variants ir: $dbhost = "localhost"; nomaini par reālo IP (ārējo) jo tad php vairs nemēģinās konektēties caur socketu bet pa taisno (TCP). Link to comment Share on other sites More sharing options...
Recommended Posts