I want to receive payments from Bitcoin on my web app, but I do not want to use corporate gateways (coinpayments, bitpay, etc), I'm wanting to make my own gateway. I do not know how best to do this but initially thought of generating the bitcoin address and storing the public/private key in MySQL after the payment was confirmed the system would use the private key and send the balance to an offline wallet.
How can I securely store the private keys that are generated for each payment in MySQL?
Let's say I do not want to leave the funds in these wallets, once I receive the system already sends the official wallet.