View previous topic :: View next topic |
Author |
Message |
lpx Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Fri Mar 31, 2006 10:49 am Post subject: I deleted user root@localhost from my mysql database....... |
|
|
Hi,
I commited a stupid mistake.
I deleted the entry root@localhost from privileges and now i cant connect.
How can i fix this?
I leave an entry there with root@%, why cant i connect?
I just did this because i couldnt connect from other machine in my network. How can i do this too?
Many thx, _________________ Imaginando o futuro
Imagining the future |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
fvant Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 08 Jun 2003 Posts: 328 Location: Leiden, The Netherlands
|
Posted: Fri Mar 31, 2006 11:40 am Post subject: |
|
|
Google with these words: reset root password mysql
and find this link for example. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lpx Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Fri Mar 31, 2006 12:12 pm Post subject: |
|
|
Hi,
Thx, but i don't need to reset the password.
I need to add privileges to acess on localhost
Basicly I want to do this:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION;
In the link you gave me there is a way of doing a command but it didnt worked...
I just dont know what to do... _________________ Imaginando o futuro
Imagining the future |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nativemad Developer
![Developer Developer](/images/ranks/rank-dev.gif)
![](images/avatars/gallery/Simpsons/Simpsons_-_Krusty.jpg)
Joined: 30 Aug 2004 Posts: 918 Location: Switzerland
|
Posted: Fri Mar 31, 2006 5:13 pm Post subject: |
|
|
I think the problem is that you try to connect through the socket... You could try something like mysql -u root -p -h 127.0.0.1
If you don`t have any data in dbs, you could also remove /var/lib/mysql and do a mysql-install-db again... If you have data, and hopefully different usernames for the dbs, you could dump them and afterwards rebuid, only the mysql-db with the permissions would get lost... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
edcoates n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2006 Posts: 1 Location: San Angelo, TX
|
Posted: Fri Mar 31, 2006 5:21 pm Post subject: Re: I deleted user root@localhost from my mysql database.... |
|
|
lpx wrote: | Hi,
I commited a stupid mistake.
I deleted the entry root@localhost from privileges and now i cant connect.
How can i fix this?
I leave an entry there with root@%, why cant i connect?
I just did this because i couldnt connect from other machine in my network. How can i do this too?
Many thx, |
Might try connecting to the database from another machine on the network with the following:
mysql -u root -h <ip address of the mysql server> -p mysql
Good luck |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lpx Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Fri Mar 31, 2006 8:06 pm Post subject: |
|
|
Hi,
Thx for the help guys.
I made by brute force. Backup tables by doing the following:
open /etc/mysql/my.cnf
write there
[mysqld]
skip-grant-tables
dump tables
run the configuration made after emerge of mysql to restore privileges
get the data again.
Everything is working fine except phpmyadmin.
It just dont work!! :S
It says that the password is wrong when every my other site are running just fine :S _________________ Imaginando o futuro
Imagining the future |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|