Change and Reset MySQL root Password MySQLÀÇ root ¾ÏÈ£¸¦ º¯°æ ¹× Àç¼³Á¤
Other then the ways specified ±×·³ ´Ù¸¥ ¹æ¹ýÀ» ÁöÁ¤ here ¿©±â¿¡ to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: ¸®¼ÂÇÏ°í ºñ¹Ð ¹øÈ£¸¦ Àؾî¹ö¸° °æ¿ì ¶Ç´Â ¼Õ½Ç¿¡¼ ¼³Á¤ÇÑ MySQL µ¥ÀÌÅͺ£À̽º¿¡ ´ëÇÑ ·çÆ® ¾ÏÈ£¸¦ º¯°æÇÏ·Á¸é, ´ÙÀ½ Áöħ ¼¼ºÎ »çÇ׿¡ Ãß°¡ ÆÄÀÏÀÌ ÇÊ¿ä¾ø´Â °¡À̵åÀÇ ¸¶Áö¸· ºÎºÐ¿¡¼ ´Ù¸¥ ¹æ¹ýÀ¸·Î ¼³¸íÀ» ¸¸µé ¼ö :
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. ·Î±×ÀÎÀ¸·Î À©µµ ¿ì³ª À¯´Ð½º ·çÆ® - MySQL ¼¹ö (À¯´Ð½º, ¸®´ª ½º³ª BSD¸¦) ±â°èó·³.
- Stop the MySQL server by using either of the following command: ´ÙÀ½ Áß Çϳª¸¦ »ç¿ëÇÏ¿© ¸í·ÉÀÇ MySQL ¼¹ö ÁßÁö :
Linux: /etc/rc.d/init.d/mysql stop ¸®´ª½º °è¿ : / etc / / init.d / mysqlÀ» ÁßÁö rc.d
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD ¿ë :ÀÌ / usr / localÀº / etc / rc.d / mysqlÀ» - server.sh ÁßÁö - Open the mysql server startup script (ie mysql-server.sh - the file executed to start or stop MySQL server. (Áï, MySQLÀÌ - server.sh - ÆÄÀÏÀ» ½ÃÀÛÇϰųª ½ÇÇà ÁßÁö MySQL ¼¹ö´Â MySQL ¼¹ö¸¦ ½ÃÀÛ ½ºÅ©¸³Æ®¸¦ ¿±´Ï´Ù.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Ãß°¡ÇÒ - °Ç³Ê¶Û - ºÎ¿© - Å×À̺íÀº ¸Å°³ º¯¼ö·Î mysqld_safe ¸í·ÉÀÌ Æ÷ÇÔµÈ ¶óÀÎÀÇ ³¡.
- Start MySQL server with the following command: ´ÙÀ½ ¸í·ÉÀ¸·Î MySQL ¼¹ö¸¦ ½ÃÀÛÇÕ´Ï´Ù :
Linux: /etc/rc.d/init.d/mysql start ¸®´ª½º °è¿ : / etc / / init.d / mysqlÀ» ½ÃÀÛ rc.d
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD ¿ë :ÀÌ / usr / localÀº / etc / rc.d / mysqlÀ» - server.sh ½ÃÀÛ - Alternatively, start the MySQL server directly and skip the editing with the following command: ¶Ç´Â, Á÷Á¢ MySQL ¼¹ö¸¦ ½ÃÀÛÇÏ°í ´ÙÀ½ ¸í·ÉÀ» ÇÔ²² ÆíÁýÀ» °Ç³Ê¶Û :
mysqld_safe –skip-grant-tables & mysqld_safe - °Ç³Ê¶Û - ºÎ¿© - Å×À̺í &
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. ±ÍÇÏÀÇ °æ·Î¸¦ ȯ°æ¿¡ µû¶ó, ´ç½ÅÀº ¿Ã¹Ù¸¥ µð·ºÅ丮¿¡ ÁöÁ¡ÀÌ ¾îµð mysqld_safe ´ë½ÅÇØ¾ß ÇÒ ¼öÀÖ½À´Ï´Ù.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: ´ÙÀ½ ¸í·ÉÀ» ½ÇÇàÇÏ¿© MySQLÀÇ »ç¿ëÀÚ·Î ·Î±×Àΰú MySQL »ç¿ëÀÚ¿¡°Ô ¿¬°á / ±ÇÇÑÀ» µ¥ÀÌÅͺ£À̽º :
# mysql -u root mysql # MySQLÀºÀº - u ·çÆ®¿¡ mysql
- Run the update queries to change the MySQL password: ¸¦ ½ÇÇàÇÏ¿© ¾ÏÈ£¸¦ º¯°æÇÏ´Â Äõ¸®´Â MySQL ¾÷µ¥ÀÌÆ® :
mysql> UPDATE user SET Password=PASSWORD(¡¯newrootpassword¡¯) WHERE User=¡¯root¡¯; MySQLÀº> ¾÷µ¥ÀÌÆ® »ç¿ëÀÚ ºñ¹Ð ¹øÈ£ ¼³Á¤ = ºñ¹Ð ¹øÈ£ ( 'newrootpassword') ¿©±â¼ user = '·çÆ®';
mysql> FLUSH PRIVILEGES; MySQLÀº> FLUSH ±ÇÇÑ;Note: Replace newrootpassword with the new root password for MySQL server. Âü°í : MySQL ¼¹ö¿¡ ´ëÇÑ »õ·Î¿î ·çÆ® ¾ÏÈ£¸¦ newrootpassword ¹Ù²Ù½Ê½Ã¿À. Flush Privileges is needed to making the password change effect immediately. Ç÷¯½Ã ºñ¹Ð ¹øÈ£¸¦ º¯°æÇÒ ±ÇÇÑÀÌ Áï½Ã È¿°ú¸¦ ¸¸µé±â À§ÇØ ÇÊ¿äÇÏ´Ù.
- Exit mysql database client by typing exit. exit¸¦ ÀÔ·ÂÇÏ¿© MySQL µ¥ÀÌÅͺ£À̽º Ŭ¶óÀÌ¾ðÆ®¸¦ Á¾·áÇÕ´Ï´Ù.
- Stop MySQL server with commands listed at step 2. MySQL ¼¹ö¸¦ ÁßÁö ¸í·ÉÀ» 2 ´Ü°è¿¡ ³ª¿Í ÇÔ²².
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. 3 ´Ü°è´Â MySQL ¼¹ö¸¦ ½ÃÀÛ ½ºÅ©¸³Æ®¸¦ ´Ù½Ã ¿±â, ÆíÁý ¹× Á¦°Å - °Ç³Ê¶Û - ºÎ¿© - Å×ÀÌºí ¸Å°³ º¯¼ö°¡ Ãß°¡µÇ¾ú½À´Ï´Ù.
- Start MySQL server by using command from step 5 or 6. 5 ´Ü°è ¶Ç´Â 6¿¡¼ ¸í·ÉÀ» »ç¿ëÇÏ¿© MySQL ¼¹ö¸¦ ½ÃÀÛÇÕ´Ï´Ù.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: ·¹µåÇÞ ¸®´ª½º »ç¿ëÀÚ¸¦ À§ÇØ, ·¹µåÇÞ ¸®´ª½º ½Ã½ºÅÛÀÇ ·çÆ® »ç¿ëÀڷμ ´ÙÀ½ ÁöħÀ» »ç¿ëÇÏ´Â °æ¿ì :
- Stop MySQL process by using command: ÁßÁö ¸í·ÉÀ» »ç¿ëÇÏ¿© MySQLÀÇ ÇÁ·Î¼¼½º :
# killall mysqld # killall mysqld
- Start the MySQL server with following options: ¿É¼ÇÀ» ´ÙÀ½°ú °°ÀÌ MySQL ¼¹ö¸¦ ½ÃÀÛÇÕ´Ï´Ù :
# /usr/libexec/mysqld -Sg –user=root & #´Â / usr / libexec / mysqld - °ÔÀÌÆ® SG - »ç¿ëÀÚ = ·çÆ® &
- Start the MySQL client: ´Â MySQL Ŭ¶óÀÌ¾ðÆ®¸¦ ½ÃÀÛÇÕ´Ï´Ù :
# mysql # MySQL˼
You should see the following message: ´ç½ÅÀº ´ÙÀ½°ú °°Àº ¸Þ½ÃÁö°¡ ³ªÅ¸³³´Ï´Ù :
Welcome to the MySQL monitor. MySQLÀÇ ¸ð´ÏÅÍ¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù. Commands end with ; or g. °°ÀÌ ¸í·É ³¡¿¡; ¶Ç´Â g. È®ÀÎ
Your MySQL connection id is 1 to server version: 3.xx.xx ´ç½ÅÀÇ MySQL ¼¹ö ¹öÀü 1·Î ¿¬°á ID : 3.xx.xxType ¡®help;¡¯ or ¡®h¡¯ for help. À¯Çü 'µµ¿ò;'¶Ç´Â 'h'´Â µµ¿ò. Type ¡®c¡¯ to clear the buffer. À¯Çü´Â 'C'¹öÆÛ¸¦ Ãë¼ÒÇÕ´Ï´Ù.
mysql> MySQL˼>
- Use mysql database: MySQL µ¥ÀÌÅͺ£À̽º¸¦ »ç¿ë :
mysql> USE mysql MySQLÀÇ> À̿뿡 mysql
You should see the following message: ´ç½ÅÀº ´ÙÀ½°ú °°Àº ¸Þ½ÃÁö°¡ ³ªÅ¸³³´Ï´Ù :
Reading table information for completion of table and column names Å×À̺í°ú Ä®·³ÀÇ ¿Ï¼º¿¡ ´ëÇÑ Á¤º¸¸¦ ¿¶÷ Å×À̺í À̸§
You can turn off this feature to get a quicker startup with -A ´ç½Å°ú ÇÔ²² ºü¸¥ ½Ãµ¿À» ¾òÀ¸·Á¸éÀÌ ±â´ÉÀ» ÇØÁ¦ÇÒ ¼öÀÖ½À´Ï´Ù - ÇÑDatabase changed µ¥ÀÌÅͺ£À̽º º¯°æ
- Then, update the password for the root user with the following command: ´ÙÀ½, ´ÙÀ½ÀÇ ¸í·ÉÀ¸·Î ·çÆ® »ç¿ëÀÚ¿¡ ´ëÇÑ ¾ÏÈ£¸¦ ¾÷µ¥ÀÌÆ® :
UPDATE user SET password=password(¡±newpassword¡±) WHERE user=¡±root¡±; = ºñ¹Ð ¹øÈ£ ( "newPassword") ¿©±â¼ user = "·çÆ®"»ç¿ëÀÚ ¼³Á¤ ºñ¹Ð ¹øÈ£¸¦ ¾÷µ¥ÀÌ Æ®;
Replace newpassword with your desired password. ÇÏ¿© ¿øÇÏ´Â ¹øÈ£·Î ¹Ù²ß´Ï´Ù newPasswordÇÕ´Ï´Ù. You should see the following message: ´ç½ÅÀº ´ÙÀ½°ú °°Àº ¸Þ½ÃÁö°¡ ³ªÅ¸³³´Ï´Ù :
Query OK, 2 rows affected (0.03 sec) °Ë»ö¾î¸¦ È®ÀÎ, 2 Çà (0.03 ÃÊ)ÀÇ ¿µÇâ
Rows matched: 2 Changed: 2 Warnings: 0 Çà°ú ÀÏÄ¡ : 2 º¯°æµÊ : 2 °æ°í : 0Rows affected may be different, but the Query OK should be there. Çà ¿µÇâ,ÇÏÁö¸¸ Äõ¸®°¡ È®ÀεǾî¾ß ´Ù¸¦ ¼öÀÖ½À´Ï´Ù.
- Flush the database privileges to reload it in order to make the changes effective: º¯°æ »çÇ×À» È¿°úÀûÀ¸·Î Ȱ¿ëÇϱâ À§ÇØ Ç÷¯½Ã µ¥ÀÌÅͺ£À̽º ±ÇÇÑÀ» ´Ù½Ã·Îµå :
mysql> flush privileges; MySQLÀº> Ç÷¯½Ã ±ÇÇÑ;
You should get the following result: ´ç½ÅÀº ´ÙÀ½ÀÇ °á°ú¸¦ ¾òÀ»ÇÑ´Ù :
Query OK, 0 rows affected (0.02 sec) °Ë»ö¾î¸¦ È®ÀÎ, 0 Çà (0.02 ÃÊ)ÀÇ ¿µÇâ
- Exit the MySQL client by typing exit. exit¸¦ ÀÔ·ÂÇÏ¿© MySQL Ŭ¶óÀÌ¾ðÆ®¸¦ Á¾·áÇÕ´Ï´Ù.
- Kill the MySQL server process by typing killall mysqld. killall mysqld¸¦ ÀÔ·ÂÇÏ¿© MySQL ¼¹ö ÇÁ·Î¼¼½º¸¦ Á׿©.
- Then start MySQL again: ±×·¸´Ù¸é MySQLÀ» ´Ù½Ã ½ÃÀÛ :
/etc/init.d/mysqld start ¿¡¼´Â / etc / init.d / mysqld ½ÃÀÛ
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. Áß¿ä :ÀÌ ±â°è´Â "º¸Áõµµ¾øÀÌÀÖ´Â ±×´ë·Î"Á¦°øµË´Ï´Ù ÆäÀÌÁö¸¦ ¹ø¿ªÇß´Ù. Machine translation may be difficult to understand. ±â°è ¹ø¿ªÀ» ÀÌÇØÇϱ⠾î·Á¿ï ¼öÀÖ½À´Ï´Ù. Please refer to À» ÂüÁ¶ÇϽñ⠹ٶø´Ï´Ù original English article ¿ø·¡ ¿µ¾î ¹®¼ whenever possible. ¾ðÁ¦µç °¡´ÉÇÕ´Ï´Ù.
Share and contribute or get technical support and help at °øÀ¯¿Í ±â¿©Çϰųª ±â¼ú Áö¿ø°ú¿¡ µµ¿òÀÌ My Digital Life Forums ³» µðÁöÅÐ »ýȰ Æ÷·³ .
Related Articles °ü·Ã ±â»ç
- Reset the Root Password of MySQL Server MySQL ¼¹öÀÇ ·çÆ® ¾ÏÈ£¸¦ Àç¼³
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 ¼³Ä¡ À¥ ¼¹ö´Â FreeBSD 6.0¿¡¼ ¾ÆÆÄÄ¡ 2.2, MySQLÀº 5.0°ú PHP 5 - 3 ºÎ
- Apple iPhone Root Password and Mobile User Password ¾ÖÇà ¾ÆÀÌÆùÀÇ ·çÆ® ÆÐ½º¿öµå¿Í ¸ð¹ÙÀÏ »ç¿ëÀÚ ºñ¹Ð ¹øÈ£
- Change or Set MySQL Long Query Time Value for log-slow-queries MySQLÀº ±ä ½Ã°£À» ¼³Á¤À» º¯°æÇϰųª Äõ¸® °ª ·Î±× - ´À¸°À§ÇÑ - Äõ¸®
- Check and Optimize MySQL Database Automatically with Crontab/Cron MySQL µ¥ÀÌÅͺ£À̽º¿¡ ÀÚµ¿À¸·Î crontabÀ» È®ÀÎÇϰí ÃÖÀûÈ / CronÀº
- Change Oracle Database User Password ¿À¶óŬ µ¥ÀÌÅͺ£À̽º »ç¿ëÀÚ ºñ¹Ð ¹øÈ£ º¯°æ
- How to Reset WordPress Password to Recover Forgotten Secret WordPressÀÇ ºñ¹Ð ¹øÈ£¸¦ º¹±¸ÇÏ´Â ¹æ¹ýÀ» Àç¼³Á¤ Àؾî¹ö¸° ºñ¹Ð
- Forgot Windows Administrator Password? Windows °ü¸®ÀÚ ¾ÏÈ£¸¦ ÀØÀ¸¼Ì½À´Ï±î? Ways to Recover and Reset Password in Vista/XP/2003/2K/NT ¹æ¹ýÀ» º¹±¸ÇÏ°í ºñ¹Ð ¹øÈ£ Àç¼³Á¤¿¡ Vista/XP/2003/2K/NT¿¡
- How to Find and Replace Text in MySQL Database using SQL ÅØ½ºÆ® ±³Ã¼ÇÏ´Â ¹æ¹ý°ú SQLÀ» »ç¿ëÇÏ¿© MySQL µ¥ÀÌÅͺ£À̽º¿¡¼ ã±â
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial ¹é¾÷ ¹× º¹¿øÇÏ´Â ¹æ¹ý (³»º¸³»±â ¹× °¡Á®¿À±â)Àº MySQL µ¥ÀÌÅͺ£À̽º¸¦ ÀÚ½À¼
June 6th, 2006 18:18 2006³â 6¿ù 6ÀÏ 18:18
[...] Alternatively, on any platform, mysql client can be used to set the new password, althought it¡¯s less secure way of resetting the password (detailed instruction here): [...] ºñ¹Ð ¹øÈ£ (ÀÚ¼¼ÇÑ ÁöħÀº ¿©±â) : [...] Àç¼³Á¤ÀÇ [...] ºñ·Ï ±×°Ô ´ú ¾ÈÀüÇÑ ¹æ¹ý ¶Ç´Â ¾î¶² Ç÷§Æû¿¡¼, MySQL Ŭ¶óÀÌ¾ðÆ® »õ ºñ¹Ð ¹øÈ£¸¦ ¼³Á¤ÇÏ´Â µ¥ »ç¿ëµÉ ¼öÀÖ½À´Ï´Ù
July 9th, 2006 12:05 2006³â 7¿ù 9ÀÏ 12:05
I wanna reset my ZXDSL 831 ADSL Modemn ³» ZXDSL 831 ADSL¿¡ Modemn Àç¼³Á¤ÇÏ·Á¸é
Plz tell me the way how to reset it PLZ ³»°¡ÇÏ´Â ¾ê±â¸¦ Àç¼³Á¤ÇÏ´Â ¹æ¹ý
I need to do that right now ³»°¡ Áö±ÝÇØ¾ß ÇÒ
Best Rgds ÃÖ°í Rgds
dugger(vincitore) dugger (vincitore)
December 19th, 2006 14:54 12 ¿ù 19 ÀÏ 2006 14:54
[...] Re: Help me retrieve my password Try this link¡¦ Change and Reset MySQL root Password [...] ´Ù½Ã :ÀÌ ¸µÅ©¸¦ ... ³» ºñ¹Ð ¹øÈ£ º¯°æ ¹× Àç¼³Á¤ MySQLÀÇ ·çÆ® ¾ÏÈ£¸¦ °Ë»ö ÇØºÁ µµ¿ò¸»
April 23rd, 2007 08:23 2007³â 4¿ù 23ÀÏ 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] º¯°æ ¹× Àç¼³Á¤ MySQLÀÇ root ¾ÏÈ£¸¦»³» µðÁöÅÐ ¶óÀÌÇÁ (ÅÂ±× : MySQLÀÇ °ü¸®) ¾Æ´Ï¿À ÅÂ±× Gelesen : 2 / ¿À´Ã : 2 [...]
May 5th, 2008 16:52 5 ¿ù 5 ÀÏ 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] judulnya), setelah °Ë»ö cuma dapat Ä«¶ó untuk mereset ´í mengganti µð ºñ¹Ð ¹øÈ£¸¦ MySQLÀÇ À¯´Ð½º - °¡ÀÔÇϼ¼¿ä. Wah, perlu sedikit modifikasi ni ¡¦ Berikut cara2 yang saya lakukan: 1. Wah º¸Åë, ¾î¸° ¾ÆÀÌ perlu sedikit modifikasi ... Berikut cara2 ¾ç Çϳª¿ä lakukan : 1. Kill proses MySQL [...] MySQLÀº proses Á׿© [...]
July 3rd, 2008 05:46 2008³â 7¿ù 3ÀÏ 5½Ã 46ºÐ
On ubuntu, command is mysqld_safe –-skip-grant-tables & ¿ìºÐÅõ¿¡¼, ¸í·ÉÀÌ´Ù mysqld_safe - °Ç³Ê¶Û - ºÎ¿© - Å×À̺í &
Extra dash is required so mysql can parse it correctly. ´ë½¬°¡ ³Ê¹« Á¤È®ÇÏ°Ô ºÐ¼®ÇÒ ¼öÀÖ´Â ¿©ºÐÀÇ MySQLÀÌ ÇÊ¿äÇÕ´Ï´Ù.
September 23rd, 2008 17:22 2008³â 9¿ù 23ÀÏ 17:22
worked for me on ubuntu, in just one line: ³ª¸¦ À§ÇØ ¿ìºÐÅõ¿¡ µü ÇÑ ¶óÀο¡¼ ÀÏÇß´Ù :
sudo dpkg-reconfigure mysql-server-5.0 ÀÌ´Â dpkg - À籸¼º¿¡ mysql - ¼¹ö´Â sudo - 5.0