mysql has oops itself

Discuss Applications
Post Reply
X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

mysql has oops itself

Post by X11 »

Yay, I can no longer long into my own mysql server, as in webmin cant even accses it, how do I reset everything (hopefully not the tables) so it works again, I dont know what the fsck happened but obviously and as usual I did somthing fscking stupid.

I just get errors like this for every database I try to goto
mysql

You do not have access to this MySQL database

ipb

You do not have access to this MySQL database

phpBB2

You do not have access to this MySQL database


DBI connect failed : Access denied for user: '@localhost' to database 'mysql'

mysql> use mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

etc
etc
etc


help

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Re: mysql has oops itself

Post by Void Main »

X11 wrote:DBI connect failed : Access denied for user: '@localhost' to database 'mysql'

mysql> use mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
It appears you connections are not telling MySQL what user you are. With a command line mysql can you tell it your are the root user and give it a password?

$ mysql --user=root -p

I believe all the user information is stored in the system database called "mysql". Did that somehow get wiped out? Did file system level permissions on it change? The files for the "mysql" database would reside in /var/lib/mysql/mysql. They should be owner/group mysql/mysql and at least rw by the mysql user and can be rw by the mysql group and no permissions for other. The mysql server process "mysqld" should be running under the "mysql" user.

Other than that did you make any configuration changes? Are there any mysql related messages in any of your system logs?

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 »

Well basically I was running a phpbb and installed a mod and it fscked the database stuff up, my friend "Sporgy" joined and her username was 1, her password was "Sporgy", and the fields were all out of wack.

I tried to fix this by rolling back the installation and deleteing the tables I had created for the mod, still was very fscked up.

I thought, this is retarded, and downloaded invision power board, and used their converter, and since then, all my passwords have been fscked, and the converter didnt work.

To get anywhere I need to reset this password...
[root@exeleven ~]# mysql --user=root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 »

Holy cow!

my wiki still works: https://kintarolabs.sytes.net/wiki/index.php/Main_Page

I can use its username/password hopefully to fix all this oops.

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 »

Okay, my mediawiki user is very limited, but that is the only important database (now backed up) since the others look pretty fscked.

I want to wipe mysql, everything and start from scratch.

I guess if I do a

# rpm -e mysql-server
# rm -rf /var/lib/mysql
# rm /etc/my.cnf

I can do this?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

I guess it's a good thing you were keeping "mysqldump --all-databases" backups so you could just reinstall mysql and restore all your databases to their previous state. You did have database dumps didn't you? My experience these things only happen if you don't have backups. That's why I have automated backups. :)

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 »

Well I lost a forum that has about 5 members and 30 posts, 20 which probably mine, no big loss.

Ill remember that in future however, im thinking of reinstalling the server with Debian/GNU and doing all the repartitioning ive wanted to do, etc. Since it was never really susposed to be a server and still runs X and stuff, I have a lot to think about at the moment, and im susposed to be at school

Runs...

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum »

Void Main wrote:I guess it's a good thing you were keeping "mysqldump --all-databases" backups so you could just reinstall mysql and restore all your databases to their previous state. You did have database dumps didn't you? My experience these things only happen if you don't have backups. That's why I have automated backups. :)
so does that mean that you never have these things happen to you then? cool!

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Calum wrote:
Void Main wrote:I guess it's a good thing you were keeping "mysqldump --all-databases" backups so you could just reinstall mysql and restore all your databases to their previous state. You did have database dumps didn't you? My experience these things only happen if you don't have backups. That's why I have automated backups. :)
so does that mean that you never have these things happen to you then? cool!
That's exactly what that means. I used to have them happen when I didn't have backups but after creating good backup procedures have never had this type of problem since. There is some law associated with this behavior isn't there? Murphy? Darwin? heh heh.

X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Post by X11 »

I've restored the Wiki and the Forum.

Automatic Database backups are now in place.

Post Reply