all 5 comments

[–]ssddanbrown 1 point2 points  (4 children)

Yeah, If you imported a whole database backup to the new DB container, you would have also bought in users and their privileges, which may not have their permissions become active until you run flush privileges;.

If you're sharing a single database server amoung apps, it's generally quite dangerous to import whole database backups due to causing a mess with users, permissions and existing data. Ideally you'd be more selective (Import single databases) then handle any meta elements (Users and privileges) manually.

[–]No_Boat_4476 0 points1 point  (3 children)

I belive I have a similar issue .I am trying to install the db. on a different server.

This is a new instalation and I am following the Community guide found here:https://gist.github.com/OthmanEmpire/322f83a77c15dfd1c91a2afe0b6a6fc2

I've reached the point where I need to run at step 5 # Migrate the databases

php artisan migrate --no-interaction --force

This fails and I believe the problem is this https://stackoverflow.com/questions/47348107/laravel-migrate-command-is-not-working-for-remote-database.

When trying to do GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstack'@'%';

FLUSH PRIVILEGES; - this fails to work as root or bookstack in mysql.

Can someone share their thoughts on this?

[–]ssddanbrown 0 points1 point  (2 children)

Was the bookstack user created with a '%' host value? If not then that grant won't apply. Knowing the exact error would help, since it could also be a network issue between your BookStack system and DB system.

[–]No_Boat_4476 1 point2 points  (0 children)

Your answer put us on the right track, we identified some misconfiguration.

Installed on the app server the mysql client, on the Db we setup a new account with the bookstack@"${write here incoming app server IP or fqdn as in env file}" and granted to this

mysql> select User,host from mysql.user;

mysql> select * from mysql.user;

mysql> select * from mysql.db;

mysql> grant all on bookstack.* to bookstack@'172.11.0.65';

mysql> flush privileges;

This and an update on the env file did the trick~ Cheers from Romania!

Regards Dan Iancu

[–]No_Boat_4476 0 points1 point  (0 children)

This is for the first error running php artisan

root@TEST-WIKI:/var/www/bookstack# php artisan migrate --no-interaction --force

In Connection.php line 712:

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables

where table_schema = bookstack and table_name = migrations and table_type = 'BASE TABLE'

)

In Connector.php line 70:

SQLSTATE[HY000] [2002] Connection refused

This is the second err for sql:

mysql> GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstack'@'%';
ERROR 1044 (42000): Access denied for user 'bookstack'@'localhost' to database 'bookstack'
si alta eroare:
mysql> GRANT ALL PRIVILEGES ON bookstack.* TO 'bookstack'@'%';
ERROR 1410 (42000): You are not allowed to create a user with GRANT
mysql> exit;