• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Converting an existing MySQL plaintext database to use SHA1

Lessaire

Omniscient Hypervisor
Joined
Dec 29, 2009
Messages
1,264
Solutions
46
Reaction score
461
Location
Oregon
Perform these in MySQL command shell or phpMyAdmin SQL tab within root of selected database:
ALTER TABLE `accounts` CHANGE `password` `plainpassword` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;
ALTER TABLE `accounts` ADD `password` CHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `name` ;
UPDATE accounts SET password=SHA1(plainpassword) ;

then change your config file and test it. if for some reason it doesn't work you can revert with this:
ALTER TABLE `accounts` DROP `password` ;
ALTER TABLE `accounts` CHANGE `plainpassword` `password` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;

and if does work and you may freely drop the old column if you wish:
ALTER TABLE `accounts` DROP `plainpassword` ;
That's it. Hope it helps someone.
 
Last edited:
Plain to SHA1?

Code:
-removed-
This go change all password Plain to Sha1.

If helped REP+

This is fucking stupid. Please remove your post from this thread immediately. The whole point of this tutorial is avoiding making irreversible changes until new configuration is known to be working. Using a hashing algorithm on the original data!!! You'd added nothing of value and only introduced a stumbling block for less skilled operators and administrators.
 
Thank you to much for this tutorial, is very helpful to me. But, can you explain better how to use this? I'm noob yet, i'm started last week with this area.

Thanks again,

*edit: I already fix it, thanks a lot!
 
Last edited:
This is fucking stupid. Please remove your post from this thread immediately. The whole point of this tutorial is avoiding making irreversible changes until new configuration is known to be working. Using a hashing algorithm on the original data!!! You'd added nothing of value and only introduced a stumbling block for less skilled operators and administrators.

Ye, that fucktard has missed the point of this thread ;/.

@Topic:
This is very helpful in case you lose plain passwords during 'upgrade' from plain to sha1. (Seen that problem few times already, when people did it wrong and lost their orginal passwords and then complaining they want it back.)
 
I have removed the post you requested, because the point of the tutorial was to create a safe SHA1 conversion.
This also helped me, thank you very much Lessaire. :)

Red
 
for my don't work! i use 0.4
need to change something in config.lua?
 
Back
Top