Install error
-
I try to install Asgardcms using composer create-project asgardcms/platform
But I get this eror:php artisan module:migrate --force
Running for module: core[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)Script php artisan module:migrate --force handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:Why does the installer looking for user with name forge?
-
This post is deleted!
-
Is anybody here?
-
Hello,
Please check https://github.com/AsgardCms/Platform/issues/188#issuecomment-208434685
Re-run the installation with the
--force
flag.
-
Before running database migration, you should be able to modify the.env
file in your project root, as well as creating a database on your server.Then in the.env
file, you can set up the database's name, user, password and host settings.If no.env
file exists on your project root, make a copy from the.env.example
file and name it.env
User forge is related to Laravel's configuration defaults, so it's expected that you have to change it properly to suit your own configuration.UPDATE: Didn't notice you create the project directly via composer create-project, please follow the instructions @nWidart gave you on the post above.
-
When I run php artisan module:migrate --force, I get:
Running for module: dashboard[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'avg.#sql-2cc0_11' (errno: 150) (SQL: alter tabledashboard__widgets
add constraint dashboard__widgets_us
er_id_foreign foreign key (user_id
) referencesusers
(id
) on delete cascade)[PDOException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'avg.#sql-2cc0_11' (errno: 150)
-
Please read the issue I linked above.
It says to empty your database...
-
Yes, I've read it. When I use php artisan module:migrate --force, my database is empty
-
I've solved this problem.
in mysql: SET GLOBAL FOREIGN_KEY_CHECKS=0;
then: module:migrate --force
and then in mysql: SET GLOBAL FOREIGN_KEY_CHECKS=1;
-
I don't understand why composer create-project asgardcms/platform runs migrations? I think that php artisan asgard:install has to run migrations...
-
That is explained in the github issue. Composer changed its behaviour on the latest version.
-
Are you going to fix this thing?
-
Of course yes, but I'm currently seeing if the composer behaviour will stay or not.
-
Follow this tutorial for installation of asgard CMS: https://www.cloudways.com/blog/how-to-install-asgardcms/
After composer command you have to use artisan command as well:
php artisan asgard:install
-
That's correct.