How to add new page to wordpress theme through coding?

If you are creating a new theme either for sale of for a client you
may want to have it create a custom page or pages when the theme is
activated.

http://wpsnipp.com/index.php/functions-php/create-page-on-theme-activation/

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