Change and Reset MySQL root Password Kaitos ir naujo MySQL root Password
Other then the ways specified Kitos tada būdais nurodyta here čia 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: iš naujo ir pakeisti root slaptažodį for MySQL duomenų bazę, tuo atveju, jei slaptažodį pamiršote arba prarastas, taip išsamiai paaiškinama alternatyviu būdu ne paskutinę dalį, vadovas, jei jokio papildomo failo reikia sukurta:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Prisijunkite kaip root Windows arba Unix-like (Unix, Linux ar BSD) mašina su MySQL server.
- Stop the MySQL server by using either of the following command: Stotelė MySQL serverio naudojant vieną iš šių komandų:
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 sustoti - Open the mysql server startup script (ie mysql-server.sh – the file executed to start or stop MySQL server. Atverti mysql serverio paleisties scenarijų (pvz., mysql-server.sh - byla įvykdytas paleisti ar sustabdyti MySQL serveryje.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Add-skip-suteikti stalai su linija, kurioje yra mysqld_safe komandą kaip jo parametru pabaigoje.
- Start MySQL server with the following command: Pradėti MySQL serverio šią komandą:
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 pradžia - Alternatively, start the MySQL server directly and skip the editing with the following command: Arba pradėti MySQL serverio tiesiogiai ir praleisti su šią komandą Redagavimas:
mysqld_safe –skip-grant-tables & mysqld_safe-skip-dotacijų stalai
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. Priklausomai nuo savo kelio aplinkai, gali tekti atkreipti dėmesį į tinkamą katalogą, kur yra mysqld_safe vietoj.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Pradėti šių komandų, kaip MySQL prisijungimo vartotojas ir prisijungti prie MySQL user / leidimo duomenų bazėje:
# mysql -u root mysql # Mysql-u root mysql
- Run the update queries to change the MySQL password: Pradėti atnaujinta queries pakeisti MySQL slaptažodį:
mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root'; mysql> UPDATE SET Password = Vartotojo slaptažodis ( "newrootpassword ') WHERE User =' root ';
mysql> FLUSH PRIVILEGES; mysql> FLUSH privilegijas;Note: Replace newrootpassword with the new root password for MySQL server. Pastaba: Pakeisti newrootpassword su nauja root slaptažodį for MySQL serveryje. Flush Privileges is needed to making the password change effect immediately. Įleistinis privilegijų reikia padaryti slaptažodžio keitimo įsigalioja nedelsiant.
- Exit mysql database client by typing exit. Išeitis MySQL database client įvesdami išeiti.
- Stop MySQL server with commands listed at step 2. Stotelė MySQL serverio komandas, išvardytų 2 žingsnis.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Atverti mysql serverio scenarijų startup taisyti 3 žingsnio ir vėl pašalinkite-skip-suteikti stalai parametras, kuris buvo pridėtas.
- Start MySQL server by using command from step 5 or 6. Pradėti MySQL serverio naudojant komandą iš 5 ir 6 žingsnius.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: , RedHat Linux vartotojams, naudokite šiuos nurodymus kaip root vartotojui, Redhat Linux machine:
- Stop MySQL process by using command: Stotelė MySQL procesas, naudojant komandą:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Pradėti MySQL serverio su šių parinkčių:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-SG-user = root &
- Start the MySQL client: Pradėti MySQL Client:
# mysql # Mysql
You should see the following message: Jūs turėtumėte pamatyti tokį pranešimą:
Welcome to the MySQL monitor. Sveiki atvykę į MySQL monitor. Commands end with ; or g. Komandos pabaigos, arba g.
Your MySQL connection id is 1 to server version: 3.xx.xx Jūsų MySQL Connection ID yra 1 Serverio versija: 3.xx.xxType 'help;' or 'h' for help. Type 'help; "arba" h "pagalbos. Type 'c' to clear the buffer. Tipo "C" išvalyti buferį.
mysql> mysql>
- Use mysql database: Naudoti MySQL duomenų bazės:
mysql> USE mysql mysql> USE mysql
You should see the following message: Jūs turėtumėte pamatyti tokį pranešimą:
Reading table information for completion of table and column names Skaitymas stalo informacijos užbaigti lentelės ir stulpelių pavadinimų
You can turn off this feature to get a quicker startup with -A Jūs galite išjungti šią funkciją gauti greičiau Paleidimas su -Database changed Duomenų bazės modelis
- Then, update the password for the root user with the following command: Tada, atnaujinkite root su šią komandą Slaptažodis:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE vartotojo SET password = password ( "Newpassword") WHERE user = "root";
Replace newpassword with your desired password. Pakeisti Newpassword su savo norimą slaptažodį. You should see the following message: Jūs turėtumėte pamatyti tokį pranešimą:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 rows įtakos (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0 Eilutės atitiktį: 2 Changed: 2 Įspėjimai: 0Rows affected may be different, but the Query OK should be there. Eilutės poveikis daromas, gali būti skirtingi, tačiau Užklausa Gerai, turėtų būti ten.
- Flush the database privileges to reload it in order to make the changes effective: Įleistinis duomenų bazės privilegijas Perkrauti kad būtų padaryti pakeitimai būtų veiksmingos:
mysql> flush privileges; mysql> flush privilegijas;
You should get the following result: Turėtumėte gauti šį rezultatą:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 įrašų nukentėjusių (0.02 sec)
- Exit the MySQL client by typing exit. Išeitis MySQL klientas įvesdami išeiti.
- Kill the MySQL server process by typing killall mysqld. Kill serveris MySQL procesą įvesdami killall mysqld.
- Then start MySQL again: Tada prasideda MySQL vėl:
/etc/init.d/mysqld start / etc / init.d / mysqld start
IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Automatinis vertimas gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.
Related Articles Susiję straipsniai
- Reset the Root Password of MySQL Server Atstatyti slaptažodį root MySQL Server
- Apple iPhone Root Password and Mobile User Password Apple iPhone root slaptažodį ir mobiliojo Vartotojas Slaptažodis
- Reset and Change Windows NT/2000 Administrator or User Password with chntpw in Linux Atkurti ir Keisti Windows NT/2000/XP administratoriaus ar vartotojo slaptažodį chntpw Linux
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Diegimas web serveris FreeBSD 6,0 su Apache 2.2, MySQL 5.0, PHP 5 - 3 dalis
- Change Oracle Database User Password Keisti Oracle Vartotojas Slaptažodis
- Change or Set MySQL Long Query Time Value for log-slow-queries Pakeisti arba nustatyti MySQL Query Time Long Vertė log-lėtai užklausos
- Check and Optimize MySQL Database Automatically with Crontab/Cron Patikrinti ir optimizuoti MySQL duomenų bazė automatiškai crontab / cron
- How to Reset WordPress Password to Recover Forgotten Secret Kaip atkurti WordPress Slaptažodis Priminti Pamiršote Secret
- Forgot Windows Administrator Password? Pamiršote Windows administratoriaus slaptažodį? Ways to Recover and Reset Password in Vista/XP/2003/2K/NT Būdų, kaip susigrąžinti ir naujo slaptažodžio Vista/XP/2003/2K/NT
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4 Įdiekite phpBB 2, Windows XP veikia Apache 2, PHP 5, MySQL 4










































September 20th, 2009 00:19 20 rugsėjis 2009 00:19
I see it worked under Ubuntu for 'trail', but it did not work for me. Matau ji dirbo pagal Ubuntu už "trasa", bet ji neveikia man.
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. Priešingai, netgi po šių Rajesh siūlymas naudoti "-skip-dotacija stalų" vietoj "-skip-dotacija stalų", net po ištaisyti klaidingą nuorodą į "/ etc / rc.d / init.d" už linux (mano Ubuntu neturi tokio katalogo, jis turi tik "/ etc / init.d /"), gaunu keistą klaidą pranešimus metu man prie 7 veiksmo.
It seems either one of two things goes wrong. Atrodo, kad iš dviejų dalykų vieną arba nieko blogo. 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)” Arba 1) serverio procesas prasideda, tada kai miršta arba 2) jei ji nustato procesą veikia ne visi, tai dar duoda man "ERROR 1045 (28000): Access neigia už '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! Ką man dar labiau trikdo tai, kad man šis paskutinis pranešimas, kai bandote paleisti ir sustabdyti 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 '&'. Galiausiai, instrukcijas redaguoti MySQL yra labai klaidinanti: vienas negali įgyvendinti "-skip-suteikti stalų" ne eilutės pabaigą, nes eilutė baigiasi peradresavimo ir '&'. The line now reads: Eilutė pakeičiama ir išdėstoma taip:
“/usr/bin/mysqld_safe –skip-grant-tables > /dev/null 2>&1 &” "/ Usr / bin / mysqld_safe-skip-dotacija stalai> / dev / null 2> & 1 &"
I am running the very latest released Ubuntu, with all updates as of yesterday. Aš einu vėliausiai išleista Ubuntu, visi kaip vakar atnaujinimus.
August 8th, 2009 10:57 8 rugpjūtis 2009 10:57
[...] This article was written based on information from [...] Šis straipsnis buvo parašytas remiantis informacija iš 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 [...] parodyti keičiasi MySQL slaptažodį [...]
March 12th, 2009 17:35 Kovas 12, 2009 17:35
@trail: Worked like a charm, thanks! @ takas: Dirbo tarsi stebuklas, ačiū!
September 23rd, 2008 17:22 23 rugsėjis 2008 17:22
worked for me on ubuntu, in just one line: dirbo mane Ubuntu, tik viena eilutė:
sudo dpkg-reconfigure mysql-server-5.0 sudo dpkg-reconfigure mysql-server-5.0
July 3rd, 2008 05:46 3 liepa 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & Ubuntu, komanda mysqld_safe - skip-dotacijų stalai
Extra dash is required so mysql can parse it correctly. Ekstra brūkšnys yra reikalingi tam, MySQL galima išanalizuoti teisingai.
May 5th, 2008 16:52 5 gegužė 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), setelah "Google" paiešką kuma dapat cara untuk mereset dan mengganti slaptažodis MySQL di UNIX di sini. Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1. Wah, perlu sedikit Paskutinė redagavimo ni ... Berikut cara2 Yang Saya lakukan: 1. Kill proses MySQL [...] Kill proses MySQL [...]
April 23rd, 2007 08:23 23 balandis 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] Kaitos ir naujo MySQL root Password »Mano skaitmeninis gyvenimas (Tags: MySQL administravimas) Nr Tags gelesen: 2 / Šiandien: 2 [...]
December 19th, 2006 14:54 19 gruodis 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Dalykas: Padėkite man atgauti savo slaptažodį paspauskite šią nuorodą ... kaitos ir naujo MySQL root Password
July 9th, 2006 12:05 9 liepa 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Noriu, kad iš naujo savo zxdsl 831 ADSL Modemn
Plz tell me the way how to reset it Plz man taip, kaip pakeisti tai
I need to do that right now Man reikia padaryti, kad dabar
Best Rgds Geriausi Rgds
dugger(vincitore) dugger (vincitore)
June 6th, 2006 18:18 6 birželis 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): [...] [...] Kita vertus, ant bet kurios platformos, MySQL klientas gali būti naudojamas nustatyti naujo slaptažodžio, nors ji ne tokia saugi, kaip iš naujo nustatyti slaptažodį (išsami instrukcija čia): [...]