日期:2014-05-16 浏览次数:20766 次
以前做的一些破事,呵呵!
?
因为我机器上 有两个 mysql 使用
将 bin 下面的 mysqld-nt.exe 改名成
mysqld-nt2.exe
将 my-small.ini 改成 my.ini
并在 my.ini中端口改成了3380
在控制台输入
bin\mysqld-nt2.exe --defaults-file=my.ini
bin\mysql.exe -uroot --port 3380 -p
?
这个方便开发者简单部署测试环境. (*^__^*) 嘻嘻……
<?
echo "Welcome to AppServ MySQL Root Password Reset Program\n\n";
AppServCMD();
function AppServCMD() {
define('STDIN',fopen("php://stdin","r"));
echo " Enter New Password : ";
$input = trim(fgets(STDIN,256));
$input = ereg_replace('\"', "\\\"", $input);
$input = ereg_replace('\'', "\'", $input);
echo "\n Please wait ...................................\n\n";
exec ("net stop mysql");
exec ('start /b d:\AppServ\MySQL\bin\mysqld-nt.exe --skip-grant-tables --user=root');
exec ("d:\AppServ\MySQL\bin\mysql -e \"update mysql.user set PASSWORD=PASSWORD('$input') where user = 'root';\"");
exec ("d:\AppServ\MySQL\bin\mysqladmin -u root shutdown");
sleep(3);
exec ("net start mysql");
} // end function
?>