Connecting to Database

  • Hi,

    Just discovered the Asgard CMS and anxious to start using it ASAP to build a couple of things. However, I'm reading a major stumbling blog - namely connecting to my database. Based on what I've reading this SHOULD be a very simple matter. For example. using MAMP, set up a db called 'testing_asgard'. In the command line:
    composer create-project asgardcms/platform testing_asgard.
    Then: localhost, tesing_asgard, root, root. (it doesn't get any more basic)

    And each time: "Please ensure your database credentials are valid.".

    I also tried this logging via the command line, creating a database in a non-MAMP directory. Same result.

    However, I was able to install Wordpress with the same credentials with no problems, ditto OctoberCMS. I've tried setting this up manually in database.php but it throws up too many errors.

    Any idea what could be happening here?

    Thanks. CMS looks great otherwise.


  • Hi Tim,

    If you are using MAMP, be sure to add the unix_socket key with the path to mysql.sock in your config/database.php

    'mysql' => array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
    'database' => 'database',
    'username' => 'root',
    'password' => 'root',
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',

  • HI Thanks a lot - Added ''unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', and got in no problem. Looking forward to getting a site up and running!

  • @timb Setting up database and connecting it shouldn't be that difficult. Use this command

    php artisan asgard:install

    This install command will perform the following actions:

    Setup database information
    Run the migrations
    Run the seeds
    Publish the assets
    Create the first admin account


Log in to reply

Looks like your connection to AsgardCms was lost, please wait while we try to reconnect.