Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ 32-bit and 64-bit integer in PHP and MySQL range     - MySQL 5.6.12 binary log path switching binlog (Database)

- Install Gnome Flashback Classic Desktop on Ubuntu 14.10 / Mint 7 (Linux)

- Manually generate AWR reports (Database)

- Install Kali Linux via PXE network (Linux)

- To share Linux script automatically change passwords (Linux)

- Apache POI Excel Document Processing (Linux)

- HBase cluster installation and deployment (Server)

- Digital jQuery scrolling effect (Programming)

- MongoDB Study Notes (1) - Install MongoDB on Windows systems (Database)

- Linux crontab (Linux)

- Linux system man help tips (Linux)

- Through Oracle to help restore MySQL data problems (Database)

- RedHat 6.5 installation and deployment Openfire (Server)

- How to download GOG games in Linux command line (Linux)

- Hibernate4 The Hello World (basic environmental structures) (Programming)

- Linux firewall Iptables study notes (Linux)

- Various sorting algorithms implemented in Python (Programming)

- How to fix Not Enough Free Disk Space On / boot on Ubuntu (Linux)

- VirtualBox modify the size of the virtual machine disk VDI (Linux)

- Oracle Character Set Summary (Database)

 
         
  32-bit and 64-bit integer in PHP and MySQL range
     
  Add Date : 2018-11-21      
         
         
         
 

A byte is 8 bits, so 32-bit int type occupies 32/8 = 4 bytes, 64-bit int type occupies 64/8 = 8 bytes.

32-bit, 64-bit unsigned integer Max:
2 ^ 64-1 = 18446744073709551615
  2 ^ 32-1 = 4294967295

  32-bit, 64-bit signed integer Max:
  (2 ^ 32) / 2-1 = 2147483647
  (2 ^ 64) / 2-1 = 9223372036854775807

1 is reduced because an integer including 0.

  64 Wei Ubuntu 14.04, PHP_INT_MAX value 9223372036854775807, with MySQL bigint type in the maximum symbol of the same
32 Wei Ubuntu 14.04, PHP_INT_MAX value of 2147483647, signed with MySQL. int type as the maximum
echo date ( 'Ymd H: i: s', PHP_INT_MAX); return 2038-01-19 11:14:07
  echo strtotime (' 2038-01. -19 11:14:07 '); return 2147483647
  echo strtotime (' 2038-01-19 11:14:08 '); 32 bits The following returns an empty
  That is, PHP on the system of time 32 bit () returns only the largest timestamp 2038-01-19 11:14:07.

field types: `posted` int (10) unsigned NOT NULL DEFAULT '0'
  on 32-bit MySQL (64 Wei MySQL too), than insert a 32-bit unsigned int type Max 2 ^ 32-1 = 4,294,967,295 larger number error occurs:
UPDATE `punbb`.`pb_topics` SET` posted` = '4294967296' WHERE `pb_topics`.`id` = 1;
  Warning: # 1264 Out of range value for column 'posted' at row 1
However, MySQL can use 8-byte bigint type to store 64-bit integers

     
         
         
         
  More:      
 
- Understand the security restore accidentally deleted critical system files (Linux)
- Virtual Judge environment to build and configure under Ubuntu (Server)
- CentOS 6.3 compile and install LNMP environment (Server)
- DM9000 timing settings (Programming)
- Orionode source Linux Mint installation (Linux)
- Linux netstat command to get started (Linux)
- Linux environmental performance data acquisition system (Linux)
- installation of Vim plugin YouCompleteMe under Ubuntu 15.04 (Linux)
- Timing Nginx logs cut and remove the log records of the specified number of days before (Server)
- How to use the TF / SD card making Exynos 4412 u-boot boot disk in Mac (Linux)
- Eclipse 3.7.2 can not start solving under Ubuntu 14.04 (Linux)
- Automate deployment of Docker-based Rails applications (Server)
- Samhain: Powerful intrusion detection system under Linux (Linux)
- Python interview must look at 15 questions (Programming)
- Linux compiler installation Redis (Database)
- CentOS 6.5 installation Python3.0 (Linux)
- Ubuntu 14.04.02 LTS startup items erroneous writing / dev / sda1 (win 7 loader) Repair (Linux)
- Ubuntu under VirtualBox virtual machine serial port settings (Linux)
- ORA-12545: Connection failed because the target host or object does not exist (Database)
- CentOS Nginx achieve 3 virtual machine load balancing (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.