=========backup and restore mariaDB databases.===========
Step1: Go to the location where you want to store database backup
now i'm creating backup of rbs database.
-mysqlidump -u root -p rbs > rbsbak.sql
check last lines of DB file to verify the file contains query lines.
-tail -n 10 brainwifibak.sql
Step2: delete database
Step3: Restore the backup database
go to location where backup database file is placed.
-mysql -u root -p -h localhost rbs < rbsbak.sql
Step 4: Create user with same privileges as super-user
GRANT ALL PRIVILEGES ON *.* TO 'tolkien'@'%';
==================create user in mariaDB=====================
Step1: Create new user
-CREATE USER 'root'@'localhost' IDENTIFIED BY 'Pakistan2';
Step2: Grant all privileges to root user to he can access all databases.
-GRANT ALL PRIVILEGES ON *.* TO 'user1'@localhost IDENTIFIED BY 'password1';
Step3: Grant permissionfor only one database
Grant all privileges to 'mike' user, to access only 'rbs' database only.
-grant all privileges on rbs.* TO 'mike'@'localhost' identified by 'fred';
useful links
1: https://phoenixnap.com/kb/how-to-create-mariadb-user-grant-privileges
Comments
Post a Comment