Tutorial: Resetarea Parolei NAVICAT MySQL pe Serverul de Joc
În acest tutorial, vă voi arăta pașii necesari pentru a reseta parola MySQL pe serverul dvs. de joc. Acești pași sunt esențiali atunci când uitați parola de root sau doriți să schimbați parola pentru un cont existent.
ATENTIE: INTRODUCETI IN PUTTY DOAR CE ESTE SCRIS CU ROSU!
Pașii pentru Resetarea Parolei NAVICAT MySQL
1. Opriți Serviciul MySQL
Primul pas este să opriți serverul MySQL. Acest lucru se face pentru a permite modificarea configurațiilor fără a fi nevoie de o parolă.
Deschideți terminalul și rulați următoarea comandă:
service mysql-server stop
Notă: Verificați dacă serviciul a fost oprit cu succes înainte de a continua.
2. Porniți MySQL în Modul de Siguranță
Acum, trebuie să porniți serverul MySQL în modul de siguranță, ceea ce vă va permite să accesați serverul fără autentificare.
Rulați următoarea comandă:
mysqld_safe --skip-grant-tables &
mysqld_safe
: Această comandă pornește serverul MySQL într-un mod mai sigur.--skip-grant-tables
: Această opțiune permite accesul la server fără a verifica permisiunile, ceea ce înseamnă că puteți accesa toate bazele de date.
3. Conectați-vă la MySQL
După ce serverul MySQL a fost pornit în modul de siguranță, deschideți o nouă fereastră de terminal și rulați următoarea comandă pentru a vă conecta la serverul MySQL:
mysql -u root
Aceasta vă va conecta la serverul MySQL ca utilizator root, fără a necesita o parolă.
4. Schimbați Parola
Odată ce sunteți conectat la server, va trebui să schimbați parola utilizatorului root. Rulați următoarele comenzi:
USE mysql;
UPDATE user SET password=PASSWORD('parola-dorita') WHERE User='root';
USE mysql;
: Această comandă selectează baza de date „mysql”, care conține informațiile despre utilizatori.UPDATE user SET password=PASSWORD('parola-dorita') WHERE User='root';
: Această comandă actualizează parola pentru utilizatorul root. Asigurați-vă că înlocuițiparola-dorita
cu parola dorită.
5. Ieșiți din MySQL
După ce ați schimbat parola, rulați comanda următoare pentru a ieși din promptul MySQL:
EXIT;
6. Repornirea Serviciului MySQL
Acum că ați schimbat parola, trebuie să opriți serverul MySQL și să îl reporniți în modul normal. Rulați următoarele comenzi:
service mysql-server restart
Aceasta va reporni serviciul MySQL.
7. Upgrade MySQL
După repornirea serverului, este o idee bună să rulați comanda de upgrade pentru a asigura că toate bazele de date și tabelele sunt actualizate:
mysql_upgrade -u root -p --verbose
Aceasta vă va cere să introduceți noua parolă pentru utilizatorul root.
8. Acordarea Permisiunilor
Pentru a permite accesul utilizatorului root de pe orice gazdă, rulați următoarea comandă:
GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'parola-dorita';
GRANT ALL ON *.*
: Acordă toate permisiunile pentru toate bazele de date.TO 'root'@'%'
: Permite accesul utilizatorului root de pe orice gazdă.
Nu uitați să înlocuiți parola-dorita
cu noua parolă dorită.
9. Ieșiți din MySQL
După ce ați acordat permisiunile necesare, ieșiți din promptul MySQL rulând comanda:
EXIT;
Concluzie
Acum ați resetat cu succes parola pentru utilizatorul MySQL root în NAVICAT pe serverul dvs. de joc. Asigurați-vă că păstrați parola într-un loc sigur și că nu o împărtășiți cu persoane neautorizate. Dacă aveți întrebări sau întâmpinați probleme, consultați documentația oficială MySQL sau căutați ajutor suplimentar online.
---------------------------------------------------------------------------------------------------------------------------------------------------------
In acest tutorial va voi arata cum puteti reseta parola MySQL la serverul dvs. de joc.
service mysql-server stop
mysqld_safe --skip-grant-tables &
mysql -u root;
use mysql;
update user set password=PASSWORD ("parola-dorita") where User='root';
exit
service mysql-server restart
mysql_upgrade -u root -p --verbose
mysql -u root -p
grant all on . to root@"%" identified by "parola-dorita";
exit
*In comenzile de mai sus inlocuiti „parola-dorita” cu parola dvs.