To list all files in current directory including dot files (hidden files or directories), as well as print permissions :
ls -laCreate database & user grant permissions
-
Once mysql / mariadb is installed:
mysql -u root -p
Where -u = User
Where -p = Password
Create a database: Note, set characture set at the same time
Where ‘application_data’ = the database name Change this for your specific requirements
CREATE DATABASE application_data CHARACTER SET utf8 COLLATE utf8_general_ci;
Create User:
Where ‘application_user’ = database user, change this to whatever user you wish
Where ‘PASSWORD’ = Your private application password
CREATE USER 'application_user'@'localhost' IDENTIFIED BY 'PASSWORD';
Give user privileges on database / there are many different reasons to learn what privileges to allow what user!
GRANT ALL PRIVILEGES ON application_data.* TO 'application_user'@'localhost';
Then always:
FLUSH PRIVILEGES;
Finally:
quit
-
Maria database
sudo su mariadb CREATE DATABASE <put your database name here without the carrots>; CREATE USER <put your password here without the carrots>@localhost IDENTIFIED BY 'put your password here'; GRANT ALL ON your database name.* TO your_username@localhost; FLUSH PRIVILEGES; exit; exit