Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
resetting mysql users and passwords
View previous topic :: View next topic  
Author Message
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 134

PostPosted: Sat Jun 14, 2014 3:59 pm    Post subject: resetting mysql users and passwords Reply with quote

Dear gerasimos_h!

I've got an older version of SMS, 1.6.0 and hope you haven't changed too much concerning passwords as they are as default since then?

From negligence I introduced a new mysql-user "root" with a specific password in an experiment of restoring a wiki-backup on another server to my SMS-server. Then created a new database with other user and own password as mysql-root. A short description of how I did this at the bottom of this post.

I noticed that my doing this disturbed your basic settings for mysql.
For instance I could no longer connect to torrentflux: See attached png.

The wiki-experiment failed and after having deleted the new database I wanted to restore your initial mysql settings.

I noticed your default databases were
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| sqlgreydb |
| test |
| torrentflux |
| weberp |
+--------------------+
Perhaps I have disturbed more than torrentflux with my changes?

I've searched your forum for mysql-problems and read these two:
http://sms.it-ccs.com/forum/viewtopic.php?t=52
link: http://sms.it-ccs.com/forum/viewtopic.php?p=3447#3447

mysql> SELECT * FROM mysql.user WHERE User='root'\G
returned two root users:
my created one at localhost with encrypted pwd
your default(?) one at sms without pwd.

Regards
Lars

How I did:
There is a full text version of how I created this root user and the new database but it's very long and I will use it if you think you can help me.

In short I did this:
Stopped mysqld [Slackware way]
# /etc/rc.d/rc.mysqld stop
Initiated mysql [probably unnecessary and may have disturbed your settings?]
# mysql_install_db --user=mysql
Started mysqld again
# /etc/rc.d/rc.mysqld stop
Set a passwd for root-mysql
# mysqladmin -u root password "[pwd-mysqlroot]"
As user logged in to mysql-root
$ mysql -u root -p
Enter password: [pwd-mysqlroot]
mysql>
Created a database "mediawiki" with an own passwd
mysql> create database mediawiki;
Set permissions/user/host/ and passwd
mysql> grant all privileges on mediawiki.* to "mediawiki"@"localhost" identified by "[pwd-mediawiki]";
Flushed privileges
mysql> flush privileges;



torrentflux-link.png
 Description:
 Filesize:  13.39 KB
 Viewed:  1157 Time(s)

torrentflux-link.png


Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Sat Jun 14, 2014 5:22 pm    Post subject: Reply with quote

It;s a good thing you add a mysql root password, now you only need to update torretflux config.php at
/var/www/htdocs/tflux/config.php
since torrentflux use mysql root user and enter your password at
$cfg["db_pass"] =

That's all...

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 134

PostPosted: Sat Jun 14, 2014 6:42 pm    Post subject: Reply with quote

In clear text? Not encrypted?

Is really no other function relying on root@localhost or root@sms and requires a working password?
Weberp, PHPinfo, Squirrelmail, Easyfirewallgenerator, PHPLdapadmin, PHPMyAdmin or Webmin?

Lars
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Sat Jun 14, 2014 8:48 pm    Post subject: Reply with quote

weberp has it's own user, you can also add one for torrentflux by entering in mysql prompt
Code:
grant all on torrentflux.* to youruser@localhost identified by 'yourpassword';

and edit the appropriate info at config.php

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 134

PostPosted: Sat Jun 14, 2014 8:56 pm    Post subject: Reply with quote

OK, but should my password go in clear text into config.php, unencrypted?
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1752
Location: Greece

PostPosted: Sat Jun 14, 2014 9:25 pm    Post subject: Reply with quote

Yes, unfortunately that's the way it goes with mysql generally, need it in clear text to be able to verify it...
So it's safer to use a user, instead of root...

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 134

PostPosted: Sat Jun 14, 2014 9:30 pm    Post subject: Reply with quote

Thank you so much gerasimos_h!

You sorted it out to me! I was worried I had disturbed you basic mysql setup with my mysql-root password Embarassed .

I'll consider using a user instead of root!

Best regards
Lars
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
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
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional