1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-29 00:06:31 +00:00
awesome-cheatsheets/databases/mysql.sh

13 lines
630 B
Bash
Raw Normal View History

2020-06-21 16:03:59 +00:00
# *****************************************************************************
# BASICS
# *****************************************************************************
2020-06-21 16:37:44 +00:00
mysqldump -h hostname -u username -p database_name -P port > file.sql # Export database
mysql -u username -p database_name < file.sql # Import database
2020-07-03 12:29:06 +00:00
SHOW PROCESSLIST; # Show you any queries that are currently running or in the queue to run
2020-09-11 09:02:31 +00:00
2020-12-03 12:04:22 +00:00
GRANT ALL PRIVILEGES ON prospectwith.* TO 'power'@'localhost' WITH GRANT OPTION; # Grant all privileges on database
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; # Create user