Mengatasi error Database Error: Unable to connect to the Database: Could not connect to MySQL


Pernahkah ketika kita upload website Joomla ke hosting muncul peringatan seperti ini : “Database Error: Unable to connect to the Database: Could not connect to MySQL” .Itu artinya ada yang salah dengan file configuration.php kamu.Mari ikuti langkah-langkah dibawah ini:

  1. Sekarang download file configuration.php dari hosting lalu edit di Dreamweaver.
  2. Lihat script ini di file config kamu, ubah seperti ini :
    var $log_path = ‘/home/[ UserCpanel ]/public_html/logs’;
    var $tmp_path = ‘/home/[ UserCpanel ]/public_html/tmp’;
    var $live_site = ‘http://domain.com’;
    var $host = ‘localhost’;
    var $user = ‘[ UserCpanel ]_ UserDatabase’;
    var $db = ‘[ UserCpanel ]_ NamaDatabase’;
    var $password = ‘PasswordDatabase’;
  3. Setelah diperiksa dan diganti, Save dan upload lagi ke hosting.

Catatan :

  • Nama database dan username akan diberi prefiks “[ UserCpanel]_” dimana UserCpanel ini diambil dari username login cPanel.
  • Jangan lupa password user MySQL case-senditive.
  • Setting var $host harus selalu ‘localhost’

Untuk lebih lengkapnya klik disini atau disini.Masalah ini juga bisa terjadi pada website yang masih offline atau di komputer lokal.

17 thoughts on “Mengatasi error Database Error: Unable to connect to the Database: Could not connect to MySQL

  1. ‘Database error: Invalid SQL: SELECT * from module where module_name=’shop’
    MySQL Error: 1146 (Table ‘160916.module’ doesn’t exist)’ kenapa ya?

  2. error database error: Unable to connect to database: could not connect MySQL

    peringatann itu keluar pada saat saya install joomla di ubuntu yang masih offline.
    cara mengatasinya gimana?? tolong

  3. cara mengatasi kayak gini gimana gan

    Database Error: Unable to connect to the database:Could not connect to database

    web kita racana.undip.ac.id

  4. mas my sql saya kok tetep error ya, pdalah sdah saya ganti sesuai dengan petunjuk diatas, kira2 a[anya ya,, terima kasih seperti ini :
    Database Error: Unable to connect to the database:Could not connect to MySQL

  5. Kalau ada eror seperti ini Your PHP server doesn’t have the MySQL module loaded or you can’t use the mysql_(p)connect functions. Bagai mana cara mengatasinya?

Leave a reply to Syaiful Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.