Skip to content

Commit ee1e22b

Browse files
committed
fix: add query to grant user access to database server
1 parent 43122a0 commit ee1e22b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Command/Database/CreateDatabaseUserCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ protected function perform(InputInterface $input, OutputInterface $output)
6666

6767
if (!$databaseServer['publicly_accessible']) {
6868
$output->newLine();
69-
$output->warn('The database user needs to be manually created on the database server because it isn\'t publicly accessible. You can use the following query to create it:');
69+
$output->warn('The database user needs to be manually created on the database server because it isn\'t publicly accessible. You can use the following queries to create it and grant it access to the server:');
7070
$output->writeln(sprintf('CREATE USER %s@\'%%\' IDENTIFIED BY \'%s\'', $user['username'], $user['password']));
71+
$output->writeln(sprintf('GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON *.* TO %s@\'%%\'', $user['username']));
7172
}
7273
}
7374
}

0 commit comments

Comments
 (0)