Sorting custom post type by usermeta

You have to add meta_key, orderby and order parameters to your query as described in the Codex: Order & Orderby Parameters:

<?php
$args = array(
    'post_type' => 'teacher',
    'paged' => $paged,
    'meta_key' => 'last_login',
    'orderby' => 'meta_value',
    'order' => 'DESC'
);
$my_custom_query = new WP_Query($args);

Also note I don’t use $wp_query variable to store the query. See WP_Query Usage for example and description why.

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