mysql> DESC USER;
+---------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+----------------+
| u_id | int(11) | NO | PRI | NULL | auto_increment |
| MOBILE_NUMBER | int(12) | NO | | NULL | |
| password | varchar(10) | NO | | NULL | |
+---------------+-------------+------+-----+---------+----------------+
3 rows in set (0.04 sec)
mysql> INSERT INTO USER (MOBILE_NUMBER,password) VALUES('9619362665','Ashish1');
ERROR 1264 (22003): Out of range value for column 'MOBILE_NUMBER' at row 1
Asked
Active
Viewed 369 times
0
RolandoMySQLDBA
- 182,700
- 33
- 317
- 520
ASAVARI
- 1
1 Answers
1
That number 9619362665 (9,619,362,665) is too big
Click This Link to See the Max Integer Types.
The biggest INT is 2147483647 (2,147,483,647).
If you want to store numbers larger than 2147483647, change the column as follows
ALTER TABLE USER MODIFY COLUMN MOBILE_NUMBER BIGINT;
Then, the INSERT should work.
RolandoMySQLDBA
- 182,700
- 33
- 317
- 520
VARCHAR(..) CHARACTER SET asciifor phone numbers. – Rick James Jun 27 '19 at 21:20