Maybe?
https://docs.moodle.org/30/en/Installing_Moodle
Does the DB user for Moodle have correct priv's?
Can you connect to the DB via command line? As the user you have in config.php file of Moodle?
Not really enough info about the system upon which you are installing, really.
'spirit of sharing', Ken