I am new to MySQL. When I declare a column as VARCHAR, why does it automatically change to VARBINARY? How should I avoid this?
Database changed
mysql> CREATE TABLE sync(
-> vlan_id INT NOT NULL,
-> vlan_name VARCHAR(90) NOT NULL,
-> vlan_description VARCHAR(100) NOT NULL,
-> PRIMARY KEY(vlan_id)
-> );
Database changed
mysql> SHOW CREATE TABLE sync;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sync | CREATE TABLE `sync` (
`vlan_id` int(11) NOT NULL,
`vlan_name` varbinary(90) NOT NULL,
`vlan_description` varbinary(100) NOT NULL,
PRIMARY KEY (`vlan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=binary |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
ALTER TABLE sync CONVERT TO CHARACTER SET utf8;
. Please let me know if it is the correct solution.