µÚÒ»ÖÖ·½·¨£º
rootÓû§µÇ¼ϵͳ
/usr/local/mysql/bin/mysqladmin -u root -p password ÐÂÃÜÂë
enter password ¾ÉÃÜÂë
µÚ¶þÖÖ·½·¨£º
rootÓû§µÇ¼mysqlÊý¾Ý¿â
mysql> update mysql.user set password=password£¨¡±ÐÂÃÜÂ롱£©where User=¡±root¡±;
mysql> flush privileges;
mysql> quit ;
mysqlÍü¼ÇrootÃÜÂëÈçºÎ´¦Àí?
Èç¹û MySQL ÕýÔÚÔËÐУ¬Ê×ÏȽáÊømysql½ø³Ì£º killall mysqld
Æô¶¯ MySQL (·ÇÕý³£·½Ê½Æð¶¯)£º/usr/local/mysql/bin/mysqld_safe ¨Cskip-grant-tables &
ÕâÑù¾Í¿ÉÒÔ²»ÐèÒªÃÜÂë½øÈë MySQL £º/usr/local/mysql/bin/mysql -u root -p¡¡£¨ÒªÇóÊäÈëÃÜÂëʱֱ½Ó»Ø³µ¼´¿É£©
mysql> update user mysql.set password=password(¡±ÐÂÃÜÂ롱) where user=¡±root¡±;
mysql> flush privileges;
mysql> quit;
ÖØнáÊø½ø³Ì£ºkillall mysqld
ÓÃÕý³£·½Ê½Æô¶¯ MySQL £º/usr/local/mysql/bin/mysqld_safe -user=mysql &
×¢:
updateÓï¾äÀïµÄpassword=password(¡±ÐÂÃÜÂ롱)Ö»ÓÐÐÂÃÜÂëÈý¸ö×ÖÔÚ²Ù×÷ʱÌæ»»³ÉÎÒÃÇÒªÉèÖõÄÃÜÂ룬ÆäËüÔÑùÕÕд£¬Ö®Ç°ÎÒ×öʧ°ÜµÄÔÒò¾ÍÔÚÓÚ°ÑÀ¨ºÅ¼°Ç°ÃæµÄpassword¸øÂÔµôÔì³ÉµÄ£®ËüÃǵÄ×÷ÓÃÊÇʹÃÜÂëÒÔ¼ÓÃܵÄÐÎʽ´æ´¢ÔÚÊý¾Ý¿âÀï¡£