Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I deleted user root@localhost from my mysql database.......
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Fri Mar 31, 2006 10:49 am    Post subject: I deleted user root@localhost from my mysql database....... Reply with quote

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
View user's profile Send private message
fvant
Guru
Guru


Joined: 08 Jun 2003
Posts: 328
Location: Leiden, The Netherlands

PostPosted: Fri Mar 31, 2006 11:40 am    Post subject: Reply with quote

Google with these words: reset root password mysql

and find this link for example.
Back to top
View user's profile Send private message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Fri Mar 31, 2006 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 918
Location: Switzerland

PostPosted: Fri Mar 31, 2006 5:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
edcoates
n00b
n00b


Joined: 31 Mar 2006
Posts: 1
Location: San Angelo, TX

PostPosted: Fri Mar 31, 2006 5:21 pm    Post subject: Re: I deleted user root@localhost from my mysql database.... Reply with quote

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
View user's profile Send private message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Fri Mar 31, 2006 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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