Created
April 24, 2017 22:52
-
-
Save kolunar/53983ee3facb1ab1068171e87d9d8edb to your computer and use it in GitHub Desktop.
MySQL dump/create database and grant all privileges to specific user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -uroot databasename > database.sql | |
mysql create database databasename DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
Option1 | |
======= | |
$ mysqldump yourFirstDatabase -u user -ppassword > yourDatabase.sql | |
$ mysql yourSecondDatabase -u user -ppassword < yourDatabase.sql | |
Option2 | |
======= | |
use databasename; | |
set autocommit = 0; | |
source database.sql; | |
commit; | |
mysql -uroot; | |
grant all on *.* to 'joomla_user'@'localhost'; | |
flush privileges; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment