How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?

How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?

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