This appears to be two separate issues.
First I am wondering what your settings are for Alerts and Notices.
Admin panel -> Settings -> Tickets -> Alerts and Notices
Secondly I am wondering about your Departments configuration.
Admin panel -> Agents -> Departments -> your department
Lastly I am wondering about your mail configuration.
Admin panel -> Emails -> Settings and Emails.
The second issue "cannot connect to database sounds like there is a problem with your database. Either PHP cannot talk to it, or there is a problem with permissions on the sock path (/var/lib/mysql/mysql.sock) or a PHP issue. Are you using the IP address or localhost in the configuration? What OS are you running? Is your disk full?
Please check your PHP and Mysql error logs to see if there is more going on.