WordPress: Using the category slug get the category ID using mysql query

Instead of writing custom SQL, you should be able to just use the native get_category_by_slug() which will return a full category object to include the category ID.

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