Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
JagoVB JagoVB is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 508
Rep Power: 15
JagoVB mempunyai hidup yang Normal
Default [ASK::PHP] Connect Database di Server Lain

gan mohon bantuan.. gimana yah caranya connect MySQL database yang servernya ada di tempat lain..

jadi misal app PHP ane di taro di server 192.168.1.141 (server lokal)

terus connect ke MySQL yang di taro di server (contoh) 112.78.131.2 (server public)

ane udah coba2 dari tadi gak bisa2




Spoiler for error:






Error has found in script C:\xampp\htdocs\product-info\src\class\MySQL.php::43

Datetime : 23 Sep 2011 / 18:18:07

Error message : mysqli_connect() [function.mysqli-connect]: Premature end of data (mysqlnd_wireprotocol.c:554)



Error has found in script C:\xampp\htdocs\product-info\src\class\MySQL.php::43

Datetime : 23 Sep 2011 / 18:18:07

Error message : mysqli_connect() [function.mysqli-connect]: OK packet 1 bytes shorter than expected



Error has found in script C:\xampp\htdocs\product-info\src\class\MySQL.php::43

Datetime : 23 Sep 2011 / 18:18:07

Error message : mysqli_connect() [function.mysqli-connect]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file











yang ane bingung dari error yang ketiga MySQL di server 112.78.131.2 itu MySQL 5.0 terus PHP yang ane pake tuh PHP 5.3..

dan kalo ane access pake MySQL Workbench mau connect




Spoiler for Sepenggal Code:







PHP Code:




require (__BASE_CLASS__ .'/Database.php');



abstract class
MySQL implements Database {

/**

* Method for connecting to SQL

*/

public static function connect() {

self::$link = mysqli_connect(self::$_host,

self::$_user,

self::$_pass,

self::$_db);

if (!
self::$link) {

die(
'Failed to connect Database '. self::$_db .' at '. self::$_host);

}

return
self::$link;

}

}

















mohon bantuannya mastah

</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
ask : ko skype ane ga mau connect ke server gan? Rudi2475 Shareware & Freeware 0 24th October 2012 02:21 PM
JUAL SEWA - FTP CLient Backup And Restore Database Server for Sql Server mousekompi Software Original & Open Source 0 26th May 2012 10:55 AM
PHP tidak connect ke database Braincode Programming 0 11th November 2011 02:21 PM

 


All times are GMT +7. The time now is 04:25 PM.