X
X
xcho19962016-03-28 07:27:06
MySQL
xcho1996, 2016-03-28 07:27:06

Mysql change field length?

how to change field length?

CREATE TABLE IF NOT EXISTS my_table (
              id int(11) unsigned NOT NULL AUTO_INCREMENT,
              timestamp int(22) NOT NULL,
              ip varchar(40) NOT NULL
              PRIMARY KEY (id)
            )

need
CREATE TABLE IF NOT EXISTS my_table (
              id int(22) unsigned NOT NULL AUTO_INCREMENT,
              timestamp int(40) NOT NULL,
              ip varchar(80) NOT NULL
              PRIMARY KEY (id)
            )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2016-03-28
@Rsa97

ALTER TABLE

A
Andrey Sanych, 2016-03-28
@mountpoint

I will give a simple advice on how to properly build such DDL data. Go to phpmyadmin, through the GUI change what you need in the table, and copy the query.
d24874e72a884445925468a5515f3022.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question