Hello i’m trying to setup my email on my server per the tutorial posted on digital ocean(https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin). When I get to the step:
INSERT INTO servermail.virtual_users
(id, domain_id, password , email)
VALUES
(‘1’, ‘1’, ENCRYPT(‘firstpassword’, CONCAT(‘$6$’, SUBSTRING(SHA(RAND()), -16))), ‘email1@example.com’),
(‘2’, ‘1’, ENCRYPT(‘secondpassword’, CONCAT(‘$6$’, SUBSTRING(SHA(RAND()), -16))), ‘email2@example.com’);
I get an error: ERROR 1305 (42000): FUNCTION servermail.ENCRYPT does not exist
How can this be fixed so I can have access to email. Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @brianallen714,
Can you confirm where exactly are you getting this error, the above mentioned
INSERT INTO `servermail`.`virtual_domains`
(`id` ,`name`)
VALUES
('1', 'example.com'),
('2', 'hostname.example.com');
Needs to be added in your MySQL DB which you have configured previously.
Are you executing the query there?
Regards, KFSys
Hello,
Think that the ENCRYPT function was depricated in the latest versions. https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html
You should be able to use the SHA2() https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_sha2
Hope this might help you.
Regards, Ivan / YoghurtPower
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.