Skip to content

Instantly share code, notes, and snippets.

@pcdinh
Created September 9, 2010 08:53
Show Gist options
  • Select an option

  • Save pcdinh/571604 to your computer and use it in GitHub Desktop.

Select an option

Save pcdinh/571604 to your computer and use it in GitHub Desktop.
#!/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