Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved][MySql] problem z logowaniem
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish)
View previous topic :: View next topic  
Author Message
professor1234
n00b
n00b


Joined: 27 Mar 2005
Posts: 62
Location: Kraków, Poland

PostPosted: Thu Jun 07, 2012 5:28 pm    Post subject: [Solved][MySql] problem z logowaniem Reply with quote

Witam,

Jakiś czas temu z'emerge'owałem mysql i phpmyadmin. Wszystko ładnie działało tylko że nie korzystając z tego zapomniałem hasła. Oczywiście w sieci jest mnóstwo opisów jak zrobić reset hasła ale jakoś to u mnie nie działa...
Poniżej kilka komunikatów błędów jakie otrzymuję:
1) jak mysql jest uruchomiony (po /etc/init.d/start):
Code:

mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

2) jak jest nieuruchomiony:
Code:

mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

PS. punktu 2) pliku mysqld.sock w ogóle nie miałem więc utworzyłem go ręcznie ale automatycznie się skasował...

Jak ktoś może mnie przeprowadzić po kroku jak ustalić nowe hasło dla roota będę wdzięczny


Last edited by professor1234 on Sun Jun 10, 2012 8:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Thu Jun 07, 2012 8:03 pm    Post subject: Reply with quote

Odpal mysqld bez tabeli uprawnien i bez sieci podlacz sie klientem i ustaw haslo rootowi. Cos jak '/usr/bin/mysqld_safe --skip-grant-tables'
Back to top
View user's profile Send private message
Gasoline
n00b
n00b


Joined: 10 Jun 2012
Posts: 2

PostPosted: Sun Jun 10, 2012 12:39 pm    Post subject: Reply with quote

Witam.

Czy próbowałeś dodać "-p"?
Code:

mysql -u root -p
Back to top
View user's profile Send private message
professor1234
n00b
n00b


Joined: 27 Mar 2005
Posts: 62
Location: Kraków, Poland

PostPosted: Sun Jun 10, 2012 8:24 pm    Post subject: Reply with quote

Serdeczne dzięki, ogólnie się udało - błąd polegał na tym jak czytałem posty, jak się to robi:
Tak ma być:
Code:

update user set password=PASSWORD(“nowe-haslo”) where User=’root’;

Tak robiłem:
Code:

update root set password=****** ;

Co ciekawe trochę działało ;) znaczy błędu nie wyświetlało.

Kopiuje jeszcze raz całą drogę, jakby ktoś potrzebował:
Code:

mysqld_safe —skip-grant-tables & // po tym poleceniu zawisła mi konsola więc w kolejnej po zalogowaniu na roota
mysql -u root
use mysql;
update user set password=PASSWORD(“NEW PASS”) where User=’root’; //nowe hasło w cudzysłowie
flush privileges;
quit


pzdr,
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum