Last active
March 1, 2016 09:15
-
-
Save maronl/55ea308073371dfba3e6 to your computer and use it in GitHub Desktop.
create mysql database for testing
This file contains 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
create DATABASE DB_XXXXXXX CHARACTER SET = utf8; | |
create user 'USER_XXX'@'localhost' identified by 'PWD_XXX'; | |
grant all on DB_XXXXXXX.* to 'USER_XXX'@'localhost'; | |
mysqldump -u root -p --single-transaction dbname | gzip > filename.sql.gz | |
grant all on dbname.* to 'username'@'%' identified by 'xxxxxx' with grant option; | |
UPDATE `mysql`.`proc` p SET definer = 'root@%’ WHERE definer=’xxxxxx@%’ AND db='dbname'; | |
mysqldump --host=hostname --port=3306 -u root -p --single-transaction db_name | gzip > dump_name.sql.gz | |
#connect hostname and port | |
mysql --host=hostname --port=3306 -u root -p | |
#import mysqldump | |
gzip -dc < dump_name.sql.gz | mysql -u root -p db_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment