MySQL错误代码1215:无法在ALTER TABLE:Mysql上添加外键约束

I want to add foreign key Constraint on my existing tables(type InnoDB) ,I have two tables listed below:

tbl_users : [ user_id(INT,AUTO_INCREMENT), user_name,--- etc]
tbl_users_meta : [ user_meta_id(INT,AUTO_INCREMENT), user_id(INT),--- etc]

I have already created index 'user_id' on 'tbl_users_meta' listed below :

enter image description here

Here is my Query but i am getting (MySQL Error Code 1215: ) each time.what is the problem i can getting it ?

ALTER TABLE `tbl_users_meta` 
ADD  CONSTRAINT `fk users user_id`
FOREIGN KEY (`user_id`) REFERENCES 
`sanskrut`.`tbl_users`(`user_id`)
ON DELETE NO ACTION ON UPDATE CASCADE;

TRY with the same query you have writen with a small modification:

ALTER IGNORE TABLE `tbl_users_meta` 
ADD  CONSTRAINT `fk users user_id`
FOREIGN KEY (`user_id`) REFERENCES 
`sanskrut`.`tbl_users`(`user_id`)
ON DELETE NO ACTION ON UPDATE CASCADE;

Hope it'll work

I can't see anything wrong with what you've written, so there must be something you haven't posted affecting the problem. For example, on MySQL version 5.5.44, I can successfully execute the following:

CREATE DATABASE sanskrut;
USE sanskrut;
CREATE TABLE tbl_users (user_id INT AUTO_INCREMENT PRIMARY KEY, user_name VARCHAR(50));
CREATE TABLE tbl_users_meta (user_meta_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT);
CREATE INDEX user_id ON tbl_users_meta (user_id);
ALTER TABLE `tbl_users_meta` 
ADD  CONSTRAINT `fk users user_id`
FOREIGN KEY (`user_id`) REFERENCES 
`sanskrut`.`tbl_users`(`user_id`)
ON DELETE NO ACTION ON UPDATE CASCADE;

...which finishes with your exact problem statement, copied and pasted, and works just fine.

I'd suspect, as I mentioned in the comments, that there's an index missing or possibly a datatype mismatch. You may find it helpful to add the output of:

DESC tbl_users;
DESC tbl_users_meta;
SHOW indexes FROM tbl_users;
SHOW indexes FROM tbl_users_meta;

...to your question.