Change and Reset MySQL root Password Zmien a Reset MySQL kmeň slová Heslo
Other then the ways specified Ostatné potom určitým spôsobom here tady 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: obnoviť a zmeniť rootovská heslo k MySQL databázu v prípade, že heslo je zabudol alebo stratil, Nasledujúce pokyny vysvetľujú podrobne iným spôsobom v poslednej časti sprievodcu, kde žiadny ďalší súbor musí byť vytvorený:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Prihlásiť sa ako root na Windows alebo Unix-like (Unix, Linux alebo BSD), stroj s MySQL serverom.
- Stop the MySQL server by using either of the following command: Stop MySQL server pomocou niektorej z nasledujúci príkaz:
Linux: /etc/rc.d/init.d/mysql stop Linux: / etc / rc.d / init.d / mysql stop
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD: / usr / local / etc / rc.d / mysql-server.sh stop - Open the mysql server startup script (ie mysql-server.sh – the file executed to start or stop MySQL server. Otvorte mysql server spúšťací skript (napr. mysql-server.sh - vykonaný súbor spustiť alebo zastaviť server MySQL.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Pridať-skip-grant-stoly na koniec riadku, ktorá obsahuje mysqld_safe príkaz ako jeho parameter.
- Start MySQL server with the following command: Štart MySQL servera s nasledujúcim príkazom:
Linux: /etc/rc.d/init.d/mysql start Linux: / etc / rc.d / init.d / mysql start
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD: / usr / local / etc / rc.d / mysql-server.sh štart - Alternatively, start the MySQL server directly and skip the editing with the following command: Potreby spustiť MySQL server priamo preskočiť a editácia s nasledujúcim príkazom:
mysqld_safe –skip-grant-tables & mysqld_safe-skip-grant-tables &
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. V závislosti na vašej ceste prostredia, môže byť potrebné, aby ukazoval na správny adresár, kde je mysqld_safe miesto.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Príkazy na prihlásenie ako užívateľ mysql a pripojenie k mysql užívateľa / oprávnenia databázy:
# mysql -u root mysql # Mysql-u root mysql
- Run the update queries to change the MySQL password: Spustite aktualizáciu otázky na zmenu MySQL heslo:
mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root'; mysql> UPDATE užívateľa SET Password = PASSWORD ( 'newrootpassword') KDE User = 'root';
mysql> FLUSH PRIVILEGES; mysql> FLUSH PRIVILEGES;Note: Replace newrootpassword with the new root password for MySQL server. Poznámka: Nahraďte newrootpassword s novou koreňovú heslo pre server MySQL. Flush Privileges is needed to making the password change effect immediately. Výsady flush je potreba k tomu, aby zmenu hesla prejavia okamžite.
- Exit mysql database client by typing exit. Exit mysql databázy klientov príkazom exit.
- Stop MySQL server with commands listed at step 2. Stop MySQL server pomocou príkazov uvedených v kroku 2.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Otvorte mysql server spúšťací skript upraviť v kroku 3 opätovne a odstrániť-skip-grant-stoly parameter, ktorý bol pridaný.
- Start MySQL server by using command from step 5 or 6. Štart MySQL server pomocou príkazu z kroku 5 alebo 6.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: Redhat Linux pre používateľov, použite nasledujúce inštrukcie ako root z Redhat Linux stroj:
- Stop MySQL process by using command: Stop MySQL procesu pomocou príkazu:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Štart MySQL server s nasledujúcich možností:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-Sg-user = root &
- Start the MySQL client: Štart MySQL klienta:
# mysql # Mysql
You should see the following message: Mali by ste vidieť nasledovné správa:
Welcome to the MySQL monitor. Welcome to the MySQL monitor. Commands end with ; or g. Commands end with; alebo g.
Your MySQL connection id is 1 to server version: 3.xx.xx MySQL spojenie id je 1 až servera verzie: 3.xx.xxType 'help;' or 'h' for help. Typ 'pomoc,' alebo 'h' for help. Type 'c' to clear the buffer. Type 'c' vymazať vyrovnávacej pamäte.
mysql> mysql>
- Use mysql database: Použite mysql databázy:
mysql> USE mysql mysql> USE mysql
You should see the following message: Mali by ste vidieť nasledovné správa:
Reading table information for completion of table and column names Čítanie tabuľke informácie pre vyplnenie tabuľky a názvy stĺpcov
You can turn off this feature to get a quicker startup with -A Môžete túto funkciu vypnúť, aby si rýchlejšie štarte sa --Database changed Databáza zmenil
- Then, update the password for the root user with the following command: Potom, aktualizujte heslo pre užívateľa root nasledujúci príkaz:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE SET heslo = heslo ( "newpassword") KDE user = "root";
Replace newpassword with your desired password. Nahraďte newpassword sa požadované heslo. You should see the following message: Mali by ste vidieť nasledovné správa:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0 Riadky uzavreté: 2 Změněno: 2 Varovanie: 0Rows affected may be different, but the Query OK should be there. Postihnuté Riadky môžu byť rôzne, ale Query OK by tam mala byť.
- Flush the database privileges to reload it in order to make the changes effective: Vyprázdnení databázy oprávnenie ho znovu načítať, aby sa zmeny účinné:
mysql> flush privileges; mysql> flush privileges;
You should get the following result: Mali by ste dostať nasledujúci výsledok:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 rows affected (0.02 sec)
- Exit the MySQL client by typing exit. Ukončite MySQL klient príkazom exit.
- Kill the MySQL server process by typing killall mysqld. Kill servera MySQL procese príkazom killall mysqld.
- Then start MySQL again: MySQL a potom začnite znova:
/etc/init.d/mysqld start / Etc / init.d / mysqld start
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: stránka je stroje preložené a za predpokladu, "ako je" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Nájdete na original English article originál Anglicky artikl whenever possible. ak je to možné.
Related Articles Súvisiace články
- Reset the Root Password of MySQL Server Root Password Reset MySQL server
- Apple iPhone Root Password and Mobile User Password Apple iPhone Root Heslo a mobilné užívateľa Heslo
- Reset and Change Windows NT/2000 Administrator or User Password with chntpw in Linux Reset a zmena Windows NT/2000 správca alebo pomocou používateľského hesla s chntpw v Linuxe
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Inštalácia webového servera vo FreeBSD 6.0 s Rýchlo 2.2, MySQL 5.0 a PHP 5 - 3. časť
- Change Oracle Database User Password Zmeniť Oracle Database Užívateľ Heslo
- Change or Set MySQL Long Query Time Value for log-slow-queries Zmeniť alebo Long Set MySQL Query Time hodnota kláda-pomalý-dotazov
- Check and Optimize MySQL Database Automatically with Crontab/Cron Skontrolovať a Optimalizácia MySQL databázu automaticky s crontab / Cron
- How to Reset WordPress Password to Recover Forgotten Secret Až k Nová sadzba WordPress Heslo až k nadobudnúť vedomie Forgotten Tajný
- Forgot Windows Administrator Password? Zabudli ste heslo správcu systému Windows? Ways to Recover and Reset Password in Vista/XP/2003/2K/NT Cesty až k nadobudnúť vedomie a Nová sadzba heslo do Vista/XP/2003/2K/NT
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4 Inštalovať phpBB 2 pre Windows XP bežiace na Apache 2, PHP 5 a MySQL 4










































September 20th, 2009 00:19 20.září 2009 00:19
I see it worked under Ubuntu for 'trail', but it did not work for me. Vidím, že pracoval pod Ubuntu pre 'chodník', ale to nie je práca pre mňa.
On the contrary: even after following Rajesh's suggestion to use “–skip-grant-tables” instead of “-skip-grant-tables”, even after correcting the erroneous reference to “/etc/rc.d/init.d” for Linux (my Ubuntu has no such directory, it has only “/etc/init.d/”) I get strange error messages by the time I get to step 7. Naopak: aj po nasledujúce návrh Rajesh na použitie "-skip-grant-stoly" namiesto "-skip-grant-tabuliek", a to aj po tom, čo sa opravuje nesprávny odkaz na "/ etc / rc.d / init.d" pre Linux (Ubuntu nemá žiadny takýto adresár, má len "/ etc / init.d /"), dostanem záhadné chybové správy v čase, keď sa dostanem ku kroku 7.
It seems either one of two things goes wrong. Zdá sa, že ani jedna z dvoch vecí, pokazí. Either 1) the server process starts, then soon dies or 2) if it finds the process running at all, it still gives me “ERROR 1045 (28000): Access denies for 'root'@'localhost' (using password: NO)” Buď 1), začne proces servera, potom sa čoskoro zomrie, alebo 2) ak zistí, že proces beží na všetkých, stále mi dáva "ERROR 1045 (28000): Access popiera pre 'root' @ 'localhost' (using password: NO) "
What has my even more baffled is that I get this last message when trying to start and stop mysql! To, čo sa mi ešte viac zmätený, že som si to posledná správa pri pokuse o spustenie a zastavenie MySQL!
Finally, the instructions to edit mysql are highly misleading: one cannot put “–skip-grant-tables” at the END of the line, since the line ends with redirection and '&'. A konečne, usmernenia úprav mysql, sú veľmi zavádzajúce: nikto nemôže dať "-skip-grant-tabuľky" na konci riadku, pretože linka končí s presmerovaním a '&'. The line now reads: Linka teraz znie:
“/usr/bin/mysqld_safe –skip-grant-tables > /dev/null 2>&1 &” "/ Usr / bin / mysqld_safe-skip-grant-stoly> / dev / null 2> & 1 &"
I am running the very latest released Ubuntu, with all updates as of yesterday. Používam najnovšiu prepustený Ubuntu, so všetkými aktualizáciami od včerajška.
August 8th, 2009 10:57 8.srpna 2009 10:57
[...] This article was written based on information from [...] Tento článok bol napísaný na základe informácií od http://www.mydigitallife.info/2006/06/06/change-and-reset-mysql-root-password/ http://www.mydigitallife.info/2006/06/06/change-and-reset-mysql-root-password/ to illustrate changing the mysql password on [...] Pre ilustráciu meniace MySQL heslo na [...]
March 12th, 2009 17:35 12.března 2009 17:35
@trail: Worked like a charm, thanks! @ Chodník: Worked like a charm, thanks!
September 23rd, 2008 17:22 23.září 2008 17:22
worked for me on ubuntu, in just one line: worked for me na ubuntu, len jeden riadok:
sudo dpkg-reconfigure mysql-server-5.0 sudo dpkg-reconfigure mysql-server-5.0
July 3rd, 2008 05:46 3.července 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & Na ubuntu, príkaz mysqld_safe - skip-grant-tables &
Extra dash is required so mysql can parse it correctly. Extra pomlčka je potrebné preto, mysql možno analyzovať správne.
May 5th, 2008 16:52 5.května 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), Setelah googling Cuma dapat cara untuk mereset dan mengganti heslo MySQL di UNIX-like di Sini. Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1. Wah, perlu sedikit modifikasi ni ... berikut cara2 jang Me lakukan: 1. Kill proses MySQL [...] Kill proses MySQL [...]
April 23rd, 2007 08:23 23.apríla 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] Burza a Nová sadzba MySQL kmeň slová Heslo »Má Digital Life (tags: mysql správa) č Tagy gelesen: 2 / heute: 2 [...]
December 19th, 2006 14:54 19.prosince 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Re: Pomôžte mi získať moje heslo Skúste tento odkaz ... Zmena a Nová sadzba MySQL kmeň slová Heslo
July 9th, 2006 12:05 9. júla 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Chcem obnoviť svoje ZXDSL 831 ADSL Modemn
Plz tell me the way how to reset it Plz oznámiť mňa spôsob, ako ho resetovať
I need to do that right now Musím to urobiť hneď teraz
Best Rgds Najlepšie Rgds
dugger(vincitore) Dugger (Víťaz)
June 6th, 2006 18:18 6.června 2006 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): [...] [...] Inak, na akejkoľvek platforme, môže byť mysql klient slúži na nastavenie nového hesla, aj keď to je menej bezpečný spôsob resetovania hesla (podrobný návod tu): [...]