Mysql Error Nr. 1025
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 Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the 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 #1025 - Error on rename (errno: 150) in mysql up vote 8 down vote favorite 1 I am trying to drop a foreign key(id) in one table(misc) which is the primary key(id) in table(main). db name(xxx) alter table misc drop FOREIGN KEY id I am getting this error #1025 - Error on rename of '.\interview#sql-edc_27' to '.\interview\misc' (errno: 150) mysql share|improve this question edited Oct 29 '13 at 20:43 juergen d 126k21133198 asked Oct 29 '13 at 20:42 black 69131224 possible duplicate of #1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) –Kermit Oct 29 '13 at 20:50 add a comment| 2 Answers 2 active oldest votes up vote 14 down vote accepted SHOW CREATE TABLE misc ; You can't drop the foreign key using the column name,run the above query to find out the correct name,something like misc_ibfk_1 Heh,IT IS this name: alter table misc drop FOREIGN KEY misc_ibfk_1 share|improve this answer answered Oct 29 '13 at 20:50 Mihai 15.3k52542 ALTER TABLE misc DROP COLUMN id to drop column . thanks –black Oct 29 '13 at 21:00 add a comment| up vote 1 down vote In my case, was necessary to make a 3-step process (my table is named "articulos", and the hard-to-remove index is "FK_Departamento_ID") For knowing the name of table, I executed: SHOW INDEX FROM articulos; This statement resolved the issue (#1025, errno: 150), but the index remained in the table ALTER TABLE articulos DROP FOREIGN KEY FK_Departamento_ID; The following statement finally wiped out the index DROP INDEX FK_Departamento_ID ON articulos; share|improve this answer answered Sep 11 '15 at 15:58 ZooMMX 4917 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged mysql or ask you
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 Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the 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 #1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) up vote 59 down vote favorite 13 So I am trying to http://stackoverflow.com/questions/19668682/1025-error-on-rename-errno-150-in-mysql add a primary key to one of the tables in my database. Right now it has a primary key like this: PRIMARY KEY (user_id, round_number) Where user_id is a foreign key. I am trying to change it to this: PRIMARY KEY (user_id, round_number, created_at) I am doing this in phpmyadmin by clicking on the primary key icon in the table structure view. This is the error I get: #1025 - Error on rename of http://stackoverflow.com/questions/4080611/1025-error-on-rename-of-database-sql-2e0f-1254ba7-to-database-table './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) It is a MySQL database with InnoDB table engine. mysql sql phpmyadmin innodb mysql-error-1025 share|improve this question edited Apr 30 '11 at 17:29 OMG Ponies 199k37360417 asked Nov 2 '10 at 17:55 Richard Knop 23.6k95284462 1 A quick search using Google gives me the idea that this problem is related to constraints. Possible helpful links: dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html and simplicidade.org/notes/archives/2008/03/mysql_errno_150.html –Lekensteyn Nov 2 '10 at 18:01 add a comment| 6 Answers 6 active oldest votes up vote 104 down vote accepted There is probably another table with a foreign key referencing the primary key you are trying to change. To find out which table caused the error you can run SHOW ENGINE INNODB STATUS and then look at the LATEST FOREIGN KEY ERROR section. share|improve this answer edited Nov 20 '14 at 11:00 trejder 6,5031366131 answered Nov 2 '10 at 18:50 Ike Walker 33.6k95278 add a comment| up vote 18 down vote For those who are getting to this question via google... this error can also happen if you try to rename a field that is acting as a foreign key. share|improve this answer answered Jun 20 '13 at 13:03 Dave C 267521 add a comment| up vote 18 down vote As was said you need to remove the FKs before. On Mysql do it like this: ALT
hashchk Error: 1001 SQLSTATE: HY000 (ER_NISAMCHK) Message: isamchk Error: 1002 SQLSTATE: HY000 (ER_NO) Message: NO Error: 1003 SQLSTATE: HY000 (ER_YES) Message: YES Error: 1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE) Message: Can't create file '%s' http://www.fromdual.com/mysql-error-codes-and-messages-1000-1049 (errno: %d) Error: 1005 SQLSTATE: HY000 (ER_CANT_CREATE_TABLE) Message: Can't create table '%s' (errno: %d) Error: 1006 SQLSTATE: HY000 (ER_CANT_CREATE_DB) Message: Can't create database '%s' (errno: %d) How does the MySQL error message look http://blog.csdn.net/woshimuyi1025/article/details/52042184 like? mysql> CREATE DATABASE test; ERROR 1006 (HY000): Can't create database 'test' (errno: 13) What does the MySQL error message mean? The MySQL Server (mysqld process) can, for whatever reason, NOT create a mysql error schema/database. Additional information you can get as follows: shell> perror 13 OS error code 13: Permission denied When does this MySQL error message happen? This MySQL error usually happens when the MySQL data directory (datadir) does not belong to the user under which the mysqld process runs. For example the data directory belongs to the user root and the mysqld process runs as user mysql. How to mysql error nr. fix this MySQL error? If the MySQL data directory does not belong to the user the mysqld process is running under, you can fix this for example as follows: shell> sudo su - shell> cd /var/lib shell> chown -R mysql:mysql mysql Alternatively you can start the mysqld process as follows: shell> bin/mysqld_safe --user=mysql or set the user accordingly in your my.cnf file. # my.cnf [mysqld] user = mysql Error: 1007 SQLSTATE: HY000 (ER_DB_CREATE_EXISTS) Message: Can't create database '%s'; database exists How does the MySQL error message look like? mysql> CREATE SCHEMA test; ERROR 1007 (HY000): Can't create database 'test'; database exists What does the MySQL error message mean? MySQL (the mysqld process) can, for whatever reason NOT create a schema/database. When does this MySQL error message happen? This MySQL error apears, as the error message states, when the database already exists. How to fix this MySQL error? You have 2 possiblities: Choose an other name for your new database / schema. Drop your old database / schema. Rename your old database / schema (we can provide you more information, how to do this). Error: 1008 SQLSTATE: HY000 (ER_DB_DROP_EXISTS) Message: Can't drop database '%s'; database doesn't exist Error:
报错 Error Nr. 1045 解决方法 标签: mysql 2016-07-27 09:19 24人阅读 评论(0) 收藏 举报 本文章已收录于: 分类: 工具(2) 作者同类文章X 1. 管理员登陆系统,停止 MySQL 服务或者结束 MySQL 进程。 2. 启动 WINDOWS 的命令行窗口(即通常的 DOS 窗口:运行cmd),切换到你的 “MySQL\bin” 目录下。 例如我的是 “D:\Program Files\MySQL\MySQL Server 5.1\bin”,然后执行下面的的命令:(注意你的 “my.ini” 位置) C:\Documents and Settings\hanfengAdministrator>cd D:\Program Files\MySQL\MySQL Server 5.1\bin C:\Documents and Settings\hanfeng>d: D:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --defaults-file="D:\Program Files\MySQL\MySQL Server 5.1\my.ini" --console --skip-grant-tables 命令执行完毕出现如下信息,说明mysql已经启动了 3. 不关闭此命令行窗口,重新打开一个命令行窗口,同样切到 “MySQL\bin” 目录下,然后执行下面的粗体的命令: C:\Documents and Settings\hanfengAdministrator>cd D:\Program Files\MySQL\MySQL Server 5.1\bin C:\Documents and Settings\hanfeng>d: D:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root mysql 然后重设密码 mysql>UPDATE user SET Password=PASSWORD('123456') where USER='root'; mysql>FLUSH PRIVILEGES; mysql>quit 4. 好了到此步,可以关闭第一个 DOS 窗口了(关闭服务)。打开系统服务控制窗口(控制面板--管理工具--服务),启动 MySQL 服务。 5.完毕,可以使用连接啦!!! 顶 0 踩 0 上一篇mysql插入数据库中文乱码 下一篇Result Maps collection already contains value for BaseResultMap 我的同类文章 工具(2) http://blog.csdn.net 参考知识库 更多资料请参考: 猜你在找 查看评论 * 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场 个人资料 woshimuyi1025 访问:3391次 积分:334 等级: 积分:334 排名:千里之外 原创:25篇 转载:36篇 译文:0篇 评论:1条 文章搜索 文章分类 java(26) 地图(1) android学习笔记(5) tomcat(3) Python学习(1) oracle问题(3) linux(3) sql语句(13) 常