Don't use root
user for creating the database, the mysql::db
type is not meant for this. Instead, specify a new user/password, you can always use root
for accessing the database later:
class { '::mysql::server': }
mysql::db { 'foo':
user => 'foo',
password => 'bar',
host => 'localhost',
sql => '/vagrant/dump.sql',
}