Recently I needed to find duplicate entries for some employees on my table. Here is a handy query
SELECT `pid`, COUNT(`pid`) AS Nummber_of_Occurrences FROM employees GROUP BY `pid` HAVING ( COUNT(`pid`) > 1 )
Yesterday, I was trying to allow access to the mysql server from outside. This post is about how you can use the mysqladmin tool or mysqldump with a remote MySQL server.
On my servers MySQL is installed and lets say one we want to reach has ip 72.32.122.15 (old sa-za ips
)
Simply create a user with necessary permissions at server you want to reach. You can use phpmyadmin for this and there enter server ip to host. You can simply modify one of the users too by changing host field for that user.
After this settings you should be able to run;
mysqladmin -h 72.32.122.15 status –user=”user-you-created” –password=”password”
I was also able to do a mysqldump such as
mysqldump -h 72.32.122.15 –user=”user-you-created” –password=”password” “database-name” > “dump-name”