If after the command :
openssl ca -out cert.pem -infiles req.pemyou got the following error message :
failed to update database TXT_DB error number 2This is probably because you have generated your own signing certificate with the same Common Name (CN) information that the CA certificate that you've generated before.
Simply input a different Common Name each time you are asked should do the trick.
Credit : 1