View previous topic :: View next topic |
Author |
Message |
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Sat Jun 14, 2014 3:59 pm Post subject: resetting mysql users and passwords |
|
|
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;
Description: |
|
Filesize: |
13.39 KB |
Viewed: |
3473 Time(s) |

|
|
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sat Jun 14, 2014 5:22 pm Post subject: |
|
|
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 |
|
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Sat Jun 14, 2014 6:42 pm Post subject: |
|
|
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 |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sat Jun 14, 2014 8:48 pm Post subject: |
|
|
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 |
|
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Sat Jun 14, 2014 8:56 pm Post subject: |
|
|
OK, but should my password go in clear text into config.php, unencrypted?
|
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sat Jun 14, 2014 9:25 pm Post subject: |
|
|
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 |
|
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Sat Jun 14, 2014 9:30 pm Post subject: |
|
|
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 .
I'll consider using a user instead of root!
Best regards
Lars
|
|
Back to top |
|
|