Mysql Error Nr 1063
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About incorrect column specifier for column mysql Us Learn more about Stack Overflow the company Business Learn more about hiring #1089 error in mysql developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the incorrect column specifier for column auto increment Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How can I avoid getting this
#1063 Phpmyadmin
MySQL error Incorrect column specifier for column COLUMN NAME? up vote 10 down vote favorite 1 How can I avoid getting this MySQL error Incorrect column specifier for column topic_id ? MySQL Error... #1063 - Incorrect column specifier for column 'topic_id' SQL Schema... CREATE TABLE discussion_topics ( topic_id char(36) NOT NULL AUTO_INCREMENT, project_id char(36) NOT NULL, topic_subject VARCHAR(255) NOT NULL, topic_content TEXT default NULL, date_created DATETIME #1089 phpmyadmin NOT NULL, date_last_post DATETIME NOT NULL, created_by_user_id char(36) NOT NULL, last_post_user_id char(36) NOT NULL, posts_count char(36) default NULL, PRIMARY KEY (topic_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; mysql sql auto-increment ddl share|improve this question edited Oct 1 '14 at 6:47 Mureinik 103k2054103 asked Oct 1 '14 at 5:52 JasonDavis 17.4k67216396 add a comment| 5 Answers 5 active oldest votes up vote 16 down vote accepted To use AUTO_INCREMENT you need to deifne column as INT or floating-point types, not CHAR. AUTO_INCREMENT use only unsigned value, so it's good to use UNSIGNED as well; CREATE TABLE discussion_topics ( topic_id INT NOT NULL unsigned AUTO_INCREMENT, project_id char(36) NOT NULL, topic_subject VARCHAR(255) NOT NULL, topic_content TEXT default NULL, date_created DATETIME NOT NULL, date_last_post DATETIME NOT NULL, created_by_user_id char(36) NOT NULL, last_post_user_id char(36) NOT NULL, posts_count char(36) default NULL, PRIMARY KEY (topic_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; share|improve this answer edited Oct 1 '14 at 6:00 Barmar 273k23126213 answered Oct 1 '14 at 5:57 M.Svrcek 1,15821223 Maybe i'm being lazy but is there an easy 1-2 sentence way to define the difference in dummy terms as to UNSIGNED vs SIGNED I have no idea what that means unfortunately and
Paul Dubois Email Updates: Status: Closed Impact on me: None Category:MySQL Server Severity:S3 (Non-critical) Version:4.1, 5.0, 5.1, ... OS:Any Assigned to: Sergey Glukhov View Add Comment Files Developer Edit Submission View Progress Log Contributions [14 Sep 2007 15:11] Paul Dubois incorrect prefix key phpmyadmin Description: The AUTO_INCREMENT column attribute is intended only for integer data types. It is correctly
Incorrect Prefix Key Phpmyadmin 1089
rejected for non-numeric types, and for DECIMAL. It is not rejected for FLOAT or DOUBLE, but it should be. How to repeat:
Mysql Error Codes List
Test script: DROP TABLE IF EXISTS t; CREATE TABLE t (i CHAR(5) AUTO_INCREMENT NOT NULL PRIMARY KEY); SHOW CREATE TABLE t\G DROP TABLE IF EXISTS t; CREATE TABLE t (i DECIMAL AUTO_INCREMENT NOT NULL PRIMARY KEY); SHOW CREATE http://stackoverflow.com/questions/26134912/how-can-i-avoid-getting-this-mysql-error-incorrect-column-specifier-for-column-c TABLE t\G DROP TABLE IF EXISTS t; CREATE TABLE t (i FLOAT AUTO_INCREMENT NOT NULL PRIMARY KEY); SHOW CREATE TABLE t\G DROP TABLE IF EXISTS t; CREATE TABLE t (i DOUBLE AUTO_INCREMENT NOT NULL PRIMARY KEY); SHOW CREATE TABLE t\G Result of running script (using 5.0.50): mysql> DROP TABLE IF EXISTS t; Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE t -> (i CHAR(5) AUTO_INCREMENT NOT NULL PRIMARY KEY); ERROR 1063 (42000): Incorrect https://bugs.mysql.com/bug.php?id=31032 column specifier for column 'i' mysql> SHOW CREATE TABLE t\G ERROR 1146 (42S02): Table 'test.t' doesn't exist mysql> mysql> DROP TABLE IF EXISTS t; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE TABLE t -> (i DECIMAL AUTO_INCREMENT NOT NULL PRIMARY KEY); ERROR 1063 (42000): Incorrect column specifier for column 'i' mysql> SHOW CREATE TABLE t\G ERROR 1146 (42S02): Table 'test.t' doesn't exist mysql> mysql> DROP TABLE IF EXISTS t; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE TABLE t -> (i FLOAT AUTO_INCREMENT NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.01 sec) mysql> SHOW CREATE TABLE t\G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `i` float NOT NULL auto_increment, PRIMARY KEY (`i`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.01 sec) mysql> mysql> DROP TABLE IF EXISTS t; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE t -> (i DOUBLE AUTO_INCREMENT NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.35 sec) mysql> SHOW CREATE TABLE t\G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `i` double NOT NULL auto_increment, PRIMARY KEY (`i`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.01 sec) [14 Sep 2007 15:54] Valerii Kravchuk Thank you for a bug report. Verified just as described. This is inconsist
The SitePoint Forums have moved. You can now find them here. This forum is now http://www.sitepoint.com/forums/showthread.php?517528-MySQL-Error closed to new posts, but you can browse existing content. You can find out more information about the move and how to open a new account (if necessary) here. If you get stuck you can get support by emailing forums@sitepoint.com If this is your first visit, be sure to check out the mysql error FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. SitePoint Sponsor User Tag List Results 1 to 8 of 8 Thread: MySQL Error Thread incorrect column specifier Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Nov 30, 2007,23:07 #1 YBH305 View Profile View Forum Posts SitePoint Zealot Join Date Nov 2007 Posts 120 Mentioned 0 Post(s) Tagged 0 Thread(s) MySQL Error Hi, I'm trying to setup a MySQL table with 3 different fields. user - username of client pass - password of client dir - directory of client I'm currently using phpmyadmin to set up the information I need. Here is the error I'm getting: PHP Code: Error
SQLquery:
CREATETABLE`ybh305_clients`.`clients`(
`user`CHAR(12)NOTNULLAUTO_INCREMENTPRIMARYKEY,
`pass`CHAR(12)NOTNULLAUTO_INCREMENT,
`dir`LONGTEXTNOTNULLAUTO