[10501] PDOException in Connection.php line 764

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'addr' at row 1

  1. $this->numRows = $this->PDOStatement->rowCount();
  2. return $this->numRows;
  3. } catch (\PDOException $e) {
  4. if ($this->isBreak($e)) {
  5. return $this->close()->execute($sql, $bind, $query);
  6. }
  7. throw new PDOException($e, $this->config, $this->getLastsql());
  8. } catch (\Throwable $e) {
  9. if ($this->isBreak($e)) {
  10. return $this->close()->execute($sql, $bind, $query);
  11. }
  12. throw $e;
  13. } catch (\Exception $e) {
  14. if ($this->isBreak($e)) {
  15. return $this->close()->execute($sql, $bind, $query);

Call Stack

  1. in Connection.php line 764
  2. at Connection->execute('INSERT INTO `mo_visi...', ['ThinkBind_1_2041306326_' => ['54.81.185.66', 2], 'ThinkBind_2_1866351820_' => ['', 2], 'ThinkBind_3_178407492_' => ['', 2], ...], object(Query)) in Connection.php line 964
  3. at Connection->insert(object(Query), false, false, null) in Query.php line 2855
  4. at Query->insert(['ip' => '54.81.185.66', 'pro' => '', 'city' => '', ...]) in Visit.php line 19
  5. at Visit->handle(object(Request), object(Closure), null)
  6. at call_user_func_array([object(Visit), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 185
  7. at Middleware->think\{closure}(object(Request))
  8. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  9. at Middleware->dispatch(object(Request)) in App.php line 435
  10. at App->run() in index.php line 21

Exception Datas

PDO Error Info
SQLSTATE 22001
Driver Error Code 1406
Driver Error Message Data too long for column 'addr' at row 1
Database Status
Error Code 10501
Error Message SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'addr' at row 1
Error SQL INSERT INTO `mo_visit_ip` (`ip` , `pro` , `city` , `addr` , `content` , `addtime`) VALUES ('54.81.185.66' , '' , '' , ' 美国弗吉尼亚州阿什本Amazon数据中心' , '{\"ip\":\"54.81.185.66\",\"pro\":\"\",\"proCode\":\"999999\",\"city\":\"\",\"cityCode\":\"0\",\"region\":\"\",\"regionCode\":\"0\",\"addr\":\" 美国弗吉尼亚州阿什本Amazon数据中心\",\"regionNames\":\"\",\"err\":\"noprovince\"}' , 1710834075)
Database Config
type mysql
hostname 127.0.0.1
database www_newguanyanhu
hostport
dsn
params []
charset utf8mb4
prefix mo_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
resultset_type array
auto_timestamp false
datetime_format Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST guanyanhui.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.newguanyanhui.com
SERVER_PORT 80
SERVER_ADDR 172.19.206.67
REMOTE_PORT 34374
REMOTE_ADDR 54.81.185.66
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.newguanyanhui.com/public
DOCUMENT_URI /index.php
REQUEST_URI /index/news/lst/cid/30/sid/242.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/news/lst/cid/30/sid/242.html
SCRIPT_FILENAME /www/wwwroot/www.newguanyanhui.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710834073.9965
REQUEST_TIME 1710834073
Environment Variablesempty
ThinkPHP Constants
PINYIN_DEFAULT 4096
PINYIN_TONE 2
PINYIN_NO_TONE 4
PINYIN_ASCII_TONE 8
PINYIN_NAME 16
PINYIN_KEEP_NUMBER 32
PINYIN_KEEP_ENGLISH 64
PINYIN_UMLAUT_V 128
PINYIN_KEEP_PUNCTUATION 256