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
#!/bin/bash | |
# clone a user | |
# usage: | |
# if you named this as below then | |
# change to the directory and run this command | |
# sudo bash clone-user.sh | |
echo "=============" | |
echo "this script will create a new user" |
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
| InnoDB | | | |
===================================== | |
2016-09-06 17:17:44 7f8702c17700 INNODB MONITOR OUTPUT | |
===================================== | |
Per second averages calculated from the last 59 seconds | |
----------------- | |
BACKGROUND THREAD | |
----------------- | |
srv_master_thread loops: 5358917 srv_active, 0 srv_shutdown, 1736765 srv_idle | |
srv_master_thread log flush and writes: 7095682 |
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
[--] Skipped version check for MySQLTuner script | |
Please enter your MySQL administrative login: root | |
Please enter your MySQL administrative password: [OK] Currently running supported MySQL version 5.6.31 | |
[OK] Operating on 64-bit architecture | |
-------- Storage Engine Statistics ----------------------------------------------------------------- | |
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA | |
[--] Data in InnoDB tables: 12G (Tables: 779) | |
[OK] Total fragmented tables: 0 | |
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
mysql -uroot -p -e "show databases" | grep -v Database | grep -v mysql| grep -v information_schema| grep -v test | grep -v OLD |gawk '{print "drop database " $1 ";select sleep(0.1);"}' | mysql -uroot -ppassword |
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
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
GROUP BY table_schema; |