Veritabanımı Codeigniter Uygulamam için yedeklemeye çalışıyorum. Benim yerel sunucuda bu kodu çalıştı ve mükemmel çalışıyor, ama canlı sunucuda aynı çalıştığınızda onun böyle bana hata gösterebilirCanlı sunucuda veritabanı yedekleme hatası veriyor
public function db_backup()
{
$prefs = array(
'tables' => array(), // Array of tables to backup.
'ignore' => array(), // List of tables to omit from the backup
'format' => 'txt', // gzip, zip, txt
'filename' => 'mybackup.sql', // File name - NEEDED ONLY WITH ZIP FILES
'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file
'add_insert' => TRUE, // Whether to add INSERT data to backup file
'newline' => "\n" // Newline character used in backup file
);
$this->dbutil->backup($prefs);
// Load the DB utility class
// Backup your entire database and assign it to a variable
$backup =& $this->dbutil->backup();
// Load the file helper and write the file to your server
$this->load->helper('file');
write_file('/uploads/mybackup.zip', $backup);
// Load the download helper and send the file to your desktop
$this->load->helper('download');
force_download('mybackup.zip', $backup);
}
:
böyle CI kullanıcı kılavuzundan kod kullanılmışbir Veritabanı hatası
oluştuhata Numarası: 1064
Eğer SQL sözdizimi bir hata var; /home/proje/kontrolörleri/admin/ayar: 28e22aafcb89a2b83643700c3f2044de
Dosya adı GELEN hattında 1
SELECT * yakın '28e22aafcb89a2b83643700c3f2044de' kullanma hakkı sözdizimi için MySQL sunucu sürümü karşılık geldiğini kılavuzu kontrol .php
Hat sayısı: 37
yanlış burada ne yapıyorum?
Utility sınıfı başlatmak için, veritabanı sürücüsü zaten çalışıyor olması gerekir. – sandeepsure
@sandeepsure ben anlamadım! Nasıl yaparım ? $ this-> load-> dbutil() yükledim; Bu ancak db sürücüsünü nasıl çalıştırabilirim? – Rajan
Tek bir masa için yapabiliyor musunuz? – sandeepsure