creating drupal database for install

From thelinuxwiki
Jump to: navigation, search

drupal version: 8. Create a new database for your site. (Change the username and databasename.)

$ mysql -u username -p -e "CREATE DATABASE <databasename> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";

Log in and set the access database rights:

$ mysql -u username -p

At the MySQL/MariaDB prompt, create the user and set the permissions using the following command (this will create the user and grant privileges):

$ CREATE USER username@localhost IDENTIFIED BY 'password';
$ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';