Yii Framework Forum: Restore Database - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Restore Database Rate Topic: -----

#1 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 03 January 2013 - 09:03 PM

Pagi agan sekalian. .

menindaklanjuti pertanyaan saya http://www.yiiframew...store-database/
alhmdlilah saya udah bsa nemuin cara yang terbilang lebih sederhana, lebih mudah, lebih praktis dan berjalan pastinya. . .hehe

intinya,
saya melakukan restore database melalui perintah command prompt yang kita jalankan lewat yii,
ini scriptnya,


public function actionRestore()
{

$dbUser = 'root';
$dbPass = '';
$database = '';

exec("D:/xampp/mysql/bin/mysql -u".$dbUser." -p".$dbPass." ".$database." < ".$database.".sql");

return $this->render('Restore');
}

- untuk user,password,nama db bisa disesuaikan,
- untuk lokasi appser jg bisa disesuiakn. . .

semoga bermanfaat gan, happy coding. . .
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users