Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Tom on January 21, 2002, 03:47:10 AM
-
I've just installed SMEServer 5.0 and it's working very well.
I've got one problem though; connecting to the MySQL database.
In another topic someone explains that the password can be found in the "/root/.my.conf" file. I did find the password but it is 74 caracters long! Is that the right one, or is it encrypted in some way?
Anyway, optimistic as I am I tried to type it in, using first root and then admin as users. It wouldn't let me in and I don't feel the urge to keep on experimenting with anymore users!
Can anyone tell me where I'm wrong? (I'm a Linux newbie, so please be gentle :o)
-
You have the right password.
Connect using "root" and that password. Once you have created a connection to the database, I'd recommend creating a new user to use for you MySQL connections - there are many tutorials on the net on how to achieve this.
-
It is the right one, yes. The good news is that you don't need to type it in at all - logging in to MySQL as root will rasd the password from the ~/.my.cnf file.
Des Dougan
-
Thanks for your replies - but I still can't log on :(
No matter which user and password I try, I get the message:
ERROR 1045: Acces denied for user: 'root@localhost' (USING password: YES)
Is it possible to reset the password, or does that mess up the entire SMEServer?
-
I have to agree with Tom (tom_AT_kvintus.dk), i´m in the same situation and i have tried the password from .my.cnf and the password from (etc/openldap/ldap.pw) and the result is the same every time:
******
MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: YES)
******
So my question is, are there anyone who has solved the problem them selves ?? in that case i would like to hear from you.
-
Jonny J wrote:
>
> I have to agree with Tom (tom_AT_kvintus.dk), i´m in the same
> situation and i have tried the password from .my.cnf and the
> password from (etc/openldap/ldap.pw) and the result is the
> same every time:
>
> ******
> MySQL Connection Failed: Access denied for user:
> 'root@localhost' (Using password: YES)
> ******
>
> So my question is, are there anyone who has solved the
> problem them selves ?? in that case i would like to hear from
> you.
You shouldn't need to enter the password, assuming your trying this from root's account. mysql will stat the .my.cnf file in your home dir and use the password defined in there.
But if you believe the passwords somehow differ and need to reset the password, you can always just skip the grants table on startup of mysql and drop in a new password, you should use the one in the .my.cnf file.
eg.
[root@sak /root]# service mysqld stop
Stopping MySQL: [ OK ]
[root@sak /root]# /usr/libexec/mysqld --user=mysql --skip-grant-tables >/dev/null &
[root@sak /root]# mysql -u root mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.36
Type 'help;' or '\h' for help. Type '\c' to clear the buffer
mysql> update user set password=password('password from /root/.my.cnf') where user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@sak /root]# ps -efa | grep mysql | head -1
mysql 7143 6918 0 04:31 pts/1 00:00:00 /usr/libexec/mysqld --user=mysql
[root@sak /root]# kill -9 7143
[1]+ Killed /usr/libexec/mysqld --user=mysql --skip-grant-tables
[root@sak /root]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.36
Type 'help;' or '\h' for help. Type '\c' to clear the buffer
--
Damien
-
Thanx i´ll try that, but wont i risk disabling the IMP-mailserver ? it uses the password from the .my.cnf file
-
The risk is all yours. Though you wont affect webmail as it doesnt use root's account, it has its own.
See the user table for more info.
--
Damien
-
I've just reset my password - and it WORKS!!!
Many thanks to you Damien for saving the day :)
Just a question:
What does the lines: "ps -efa | grep mysql | head -1" And "kill -9 7143" do?
-
Tom wrote:
> Just a question:
> What does the lines: "ps -efa | grep mysql | head -1" And
> "kill -9 7143" do?
Oh dont just run that. The 1st line just told me the pid of mysql and the second line killed that process.
Thats because I had mysql running without the grants table, and needed to restart it properly.
--
Damien
-
Ahh, that's why I got some strange responses :)
Thanks again for the explanation.
-
Here is a model of the grant statement I use successfully for PHP/MYSQL connection to the database
(from MYSQL site - http://www.mysql.com/doc/A/d/Adding_users.html)
shell> mysql --user=root mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO someuser@localhost
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO somuser@"%"
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
-
Try resetting the root mysql password. See:
http://www.mysql.com/doc/en/Resetting_permissions.html
-
Woha - you did realise that topic was over a year old, didn't you :)
-
I will pay more attention to the dates from now on. Thanks.