Broken images in media library

I had this issue. It miraculously went away when I unchecked the option to save media in year and month subdirectories. Weird.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)