Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to configure Database in CakePHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 220
    Comment on it

    CakePHP database configuration details are in a file that is located at app/Config/database.php. the database file. You can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database. Here we are describing the code that will be in database . It helps you to configure database in cakePHP

    class DATABASE_CONFIG
    public $default =array(
    'datasource'=> 'Database/Mysql',
    'persistent'=> false,
    'host'=> 'localhost',//The database servers hostname (or IP address).
    'login'=> 'demodata', // The username for the database account.
    'password'=> 'password',//password for the account.
    'database'=> 'demodb',//name of the database
    'prefix'=> ''
    );
    }
    {
    

    There are some other options too in database config file-

    prefix (optional) The string that prefixes every table name in the database.

    port (optional) The TCP port to connect to the server.

    mysql/mysqli connections you must use utf8 without the hyphen.

    ssl_key The file path to the SSL key file. ssl_cert The file path to the SSL certificate file.

    ssl_ca The file path to the SSL certificate authority.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: