Thinkphp,pdo connects to the database, and host is automatically replaced with native ip

class DBAccess extends PDO{
    private $charset;    // 
    public $cacheDir="_cache_$98sdf29@fw!d-sharps4fef/";
    public $prename;
    public $time;
    function __construct($dsn, $user="", $password=""){
        try{
            parent::__construct($dsn, $user, $password);
        }catch(Exception $e){
//            throw new Exception("");
//            throw new Exception($e->getMessage());
//            print_r($user);
            print_r($dsn);
            print_r($e->getMessage());
        }
        $this->time=intval($_SERVER["REQUEST_TIME"]);
    }
}

clipboard.png

host is automatically replaced. What"s going on?

Php
Oct.05,2021

system configuration that you won't change. Take a look at the configuration introduction in the thinkphp manual


configuration file, bro. Who told you to change the source code.


I have encountered a similar situation, setting abc@123.123.123.123 to be accessible, and my local machine is also 123.123.123.123 , but the error message is that abc@456.456.456.456 does not have permission. The difference is that 456.456.456.456 is not the ip of the host where mysql resides. Can only be accessed by changing to abc@% . I never understood why.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b352f0-2bf7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b352f0-2bf7e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?