Command to create mysql user
============================
CREATE USER 'username'@'localhost' IDENTIFIED by 'password';
Command to grant all privileges to a user to databases starting with any name
=============================================================================
GRANT ALL PRIVILEGES ON database_.* TO 'username'@'localhost' IDENTIFIED BY 'password';
flush privileges;
The above two line command will make the user "username" to have all the privileges to add delete modify databases that starts with the name database_.
Command to dump mysql database
==============================
mysqldump -u [databaseusername] -p[password] databasename > databasebackup.sql
Command to restore mysql database
=================================
mysqldump -u [databaseusername] -p[password] databasebackup.sql < databasename
No comments:
Post a Comment