Error: ActiveRecord::StatementInvalid (Mysql::Error: SELECT command denied to user 'root'@'10.100.10.135'
Added by Cyro Bezerra about 14 years ago
Hi,
After I restored the backup and changed the IP of the machine I no longer create a new task. When I try to create this error appears: "Error: ActiveRecord::StatementInvalid (Mysql::Error: SELECT command denied to user 'root'@'10.100.10.135'" Where can I change the server IP in Redmine?
Old IP: 10.100.10.135
New IP: 10.100.10.2
Replies (3)
RE: Error: ActiveRecord::StatementInvalid (Mysql::Error: SELECT command denied to user 'root'@'10.100.10.135' - Added by Felix Schäfer about 14 years ago
That seems to the database config, which is in /your/redmine_dir/conf/database.yml
.
RE: Error: ActiveRecord::StatementInvalid (Mysql::Error: SELECT command denied to user 'root'@'10.100.10.135' - Added by Cyro Bezerra about 14 years ago
I solved the problem. The error was generated by a trigger associated with the table "ISSUES". This trigger is standard, or somebody that was created in our system?
Here is the code:
-- Trigger DDL Statements DELIMITER $$ USE `redmine`$$ CREATE DEFINER=`redmine`@`localhost` <--------------- The problem is here and TRIGGER `redmine`.`beforeInsertIssue` BEFORE INSERT ON `redmine`.`issues` FOR EACH ROW BEGIN IF NEW.status_id = 1 THEN SET NEW.start_date = null; END IF; END$$ CREATE DEFINER=`redmine`@`localhost` <------------------ here. TRIGGER `redmine`.`beforeUpdateIssue` BEFORE UPDATE ON `redmine`.`issues` FOR EACH ROW BEGIN IF NEW.status_id = 1 THEN SET NEW.start_date = null; END IF; IF OLD.due_date IS NOT NULL AND NEW.due_date <> OLD.due_date THEN IF exists (SELECT * FROM custom_values WHERE customized_id = NEW.id AND custom_field_id = 13 AND customized_type = 'Issue' ) THEN UPDATE custom_values set value = NEW.due_date WHERE customized_id = NEW.id AND custom_field_id = 13 AND customized_type = 'Issue'; ELSE INSERT INTO custom_values (customized_type,customized_id,custom_field_id,value) VALUES ('Issue',NEW.id,13,NEW.due_date); END IF; SET NEW.due_date = OLD.due_date; END IF; END$$
RE: Error: ActiveRecord::StatementInvalid (Mysql::Error: SELECT command denied to user 'root'@'10.100.10.135' - Added by Felix Schäfer about 14 years ago
Redmine uses databases only as a "CRUD datastore", i.e. doesn't meddle with triggers or whatever, not even foreign constraints or similar, so it's something someone did at your place.