mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-23 06:02:12 +01:00
Merge pull request #50 from ponsfrilus/master
Added mysqdump backup and restore and basic connection
This commit is contained in:
commit
f695290b36
1 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,14 @@
|
||||||
|
# To connect to a database
|
||||||
|
mysql -h localhost -u root -p
|
||||||
|
|
||||||
# To create a database in utf8 charset
|
# To create a database in utf8 charset
|
||||||
CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
|
CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||||||
|
|
||||||
# To add a user and give rights on the given database
|
# To add a user and give rights on the given database
|
||||||
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;
|
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;
|
||||||
|
|
||||||
|
# To backup all databases
|
||||||
|
mysqldump --all-databases --all-routines -u root -p > ~/fulldump.sql
|
||||||
|
|
||||||
|
# To restore all databases
|
||||||
|
mysql -u root -p < ~/fulldump.sql
|
||||||
|
|
Loading…
Reference in a new issue