MySQL is one of the most popular database which is used for php based sites, like WordPress, Question2Answer. Here are simple steps to create MySQL database and grant required permissions to database user.
Login to MySQL by using command
mysql -u USERNAME -p
it will ask for password, enter.
After above step you will see MySQL prompt.
mysql>
Create database
mysql> create database NEWDB;
Add user with password for database
mysql> grant usage on *.* to NEWDBADMIN@localhost identified by ‘YOURSTRONGPASSWORD’;
Grant all permissions for NEWDBADMIN user
mysql> grant all privileges on NEWDB.* to NEWDBADMIN@localhost;
You can use above credentials in wp-config.php for WordPress or qa-config.php for Question2Answer and install.