Created
September 9, 2010 08:53
-
-
Save pcdinh/571604 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/local/php5-fcgi/bin/php | |
| <?php | |
| $out = shell_exec('mysql -u root -p'); | |
| if (false !== strpos($out, 'Enter password')) { | |
| fwrite(STDOUT, "mypassword-here"); | |
| $resp = trim(fgets(STDIN)); | |
| fwrite(STDOUT, $resp); | |
| } | |
| exit(0); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment