PDA

View Full Version : mysql root



Guiminha
2007-10-03, 15:23
Hi there folks,

This is my first post to the forum, so a warm hello from Brazil!

I installed the slimserver .deb packs and all the dependencies (mysql, perl, etc) that followed.. Now, I want to use MySQL to do something else, but I can not login as root (mysql -u root -p) since I don't know which password was set.

I understand this is a MySQL issue, but since it was installed with the SlimServer (and I don't want to brake it), I though someone here might be able to help me.

So, do you know if there is a default password set for the MySQL root? How does the SlimServer creates and manages its MySQL database?

Regards,

G

Mark Miksis
2007-10-03, 15:32
A default MySQL installation has no root password unless the debian package creates one.

snarlydwarf
2007-10-03, 15:33
On debian, the password is set during the initial install of mysql-server. The default is blank (which isn't as insecure as it sounds, since the default is also to not listen on the network...).

If you took the default, this should work:
mysql -u root

If you changed it, there is no longer a good way to get at it, since it is no longer saved. (It used to be saved in ~root/.my_cnf, but now the install script sets the password and then forgets it.)

You may be best off to purge mysql-server-5.0 and then reinstall to allow you to reset the password.

Guiminha
2007-10-03, 16:16
You may be best off to purge mysql-server-5.0 and then reinstall to allow you to reset the password.

I reseted the password with:

/usr/sbin/mysqld --bootstrap --skip-grant-tables --basedir=/ --datadir=/var/lib/mysql << bla
> update mysql.user set password='' where user='root';
> bla

And created a new one with: mysqladmin -u root password NEWPASSWORD

I was afraid the SlimServer could break, but apparently it sets its own user/database password. And everything is fine now.

Thanks for the quick replies

G