MySQL
Find Out Which Repository an RPM is Installed From
You might be wondering which an rpm package came from. When yum info
will list “installed” instead of which repository, well here is a one liner that can help:
rpm -q gpg-pubkey --provides | grep `rpm -qi
Here is a sample:
[root@vm-linux-01 ~]# rpm -q gpg-pubkey --provides | grep `rpm -qi mysql-server|grep Signature|awk '{print $(NF)}'|tail -1`
gpg(Atomic Rocket Turtle
gpg(5ebd2744) = 4:32a951145ebd2744-418ffac9
So we know that mysql-server came from the Atomic repo
Quick Backup of All MySQL Databases
Create a quick backup of all MySQL databases via mysqldump on the current directory. Replace USERNAME and PASSWORD with your own.
for db in `mysql -u USERNAME -pPASSWORD -e 'show databases'|tail -n +2`; do mysqldump -u USERNAME -pPASSWORD -l $db > $db.sql; done;