Redmine 数据库连接错误

/********************************************************************
 *                    Redmine 数据库连接错误
 * 说明:
 *     OpenMediaVault上的Redmine出现连接错误,目前不知道是我自己不小心
 * 把mysql的密码修改了,还是因为被攻击了,先记录一下。
 *
 *                                  2016-8-17 深圳 南山平山村 曾剑锋
 *******************************************************************/

一、参考文档:
    1. 完整过程解决 ERROR 1045 (28000): Access denied for user ‘mysql‘@‘localhost‘ (using password: NO)
        http://blog.csdn.net/nel0511/article/details/13091163

二、错误现象:
    [email protected]:/etc# ruby /usr/share/redmine/bin/rails server -p3000 webrick -e production &
    [1] 2828
    [email protected]:/etc# => Booting WEBrick
    => Rails 3.1.8 application starting in production on http://0.0.0.0:3000
    => Run `rails server -h` for more startup options
    => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
    => Ctrl-C to shutdown server
    Exiting
    /usr/lib/ruby/vendor_ruby/mysql2/client.rb:70:in `connect‘: Access denied for user ‘root‘@‘localhost‘ (using password: YES) (Mysql2::Error)
            from /usr/lib/ruby/vendor_ruby/mysql2/client.rb:70:in `initialize‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql2_adapter.rb:18:in `new‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout‘
            from /usr/lib/ruby/1.1.0/monitor.rb:211:in `mon_synchronize‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection‘
            from /usr/lib/ruby/1.1.0/monitor.rb:211:in `mon_synchronize‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_handling.rb:113:in `retrieve_connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/connection_handling.rb:87:in `connection‘
            from /usr/lib/ruby/vendor_ruby/active_record/model_schema.rb:209:in `table_exists?‘
            from /usr/lib/ruby/vendor_ruby/active_record/attribute_methods/primary_key.rb:99:in `get_primary_key‘
            from /usr/lib/ruby/vendor_ruby/active_record/attribute_methods/primary_key.rb:84:in `reset_primary_key‘
            from /usr/lib/ruby/vendor_ruby/active_record/attribute_methods/primary_key.rb:72:in `primary_key‘
            from /usr/lib/ruby/vendor_ruby/active_record/mass_assignment_security/attribute_assignment.rb:15:in `attributes_protected_by_default‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:332:in `block in protected_attributes_configs‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:217:in `yield‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:217:in `protected_attributes‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:123:in `block in attr_protected‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:122:in `each‘
            from /usr/lib/ruby/vendor_ruby/active_model/mass_assignment_security.rb:122:in `attr_protected‘
            from /usr/share/redmine/app/models/custom_field.rb:32:in `<class:CustomField>‘
            from /usr/share/redmine/app/models/custom_field.rb:18:in `<top (required)>‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `block in require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:232:in `load_dependency‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:348:in `require_or_load‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:480:in `load_missing_constant‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:180:in `const_missing‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:512:in `load_missing_constant‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:180:in `const_missing‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:512:in `load_missing_constant‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:180:in `const_missing‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:512:in `load_missing_constant‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:180:in `const_missing‘
            from /usr/share/redmine/lib/redmine/field_format.rb:80:in `field_attributes‘
            from /usr/share/redmine/lib/redmine/field_format.rb:83:in `<class:Base>‘
            from /usr/share/redmine/lib/redmine/field_format.rb:48:in `<module:FieldFormat>‘
            from /usr/share/redmine/lib/redmine/field_format.rb:19:in `<module:Redmine>‘
            from /usr/share/redmine/lib/redmine/field_format.rb:18:in `<top (required)>‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `block in require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:232:in `load_dependency‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/share/redmine/lib/redmine.rb:38:in `<top (required)>‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `block in require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:232:in `load_dependency‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/share/redmine/config/initializers/30-redmine.rb:6:in `<top (required)>‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:241:in `load‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:241:in `block in load‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:232:in `load_dependency‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:241:in `load‘
            from /usr/lib/ruby/vendor_ruby/rails/engine.rb:648:in `block in load_config_initializer‘
            from /usr/lib/ruby/vendor_ruby/active_support/notifications.rb:161:in `instrument‘
            from /usr/lib/ruby/vendor_ruby/rails/engine.rb:647:in `load_config_initializer‘
            from /usr/lib/ruby/vendor_ruby/rails/engine.rb:612:in `block (2 levels) in <class:Engine>‘
            from /usr/lib/ruby/vendor_ruby/rails/engine.rb:611:in `each‘
            from /usr/lib/ruby/vendor_ruby/rails/engine.rb:611:in `block in <class:Engine>‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers‘
            from /usr/lib/ruby/1.1.0/tsort.rb:226:in `block in tsort_each‘
            from /usr/lib/ruby/1.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component‘
            from /usr/lib/ruby/1.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from‘
            from /usr/lib/ruby/1.1.0/tsort.rb:427:in `each_strongly_connected_component_from‘
            from /usr/lib/ruby/1.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child‘
            from /usr/lib/ruby/1.1.0/tsort.rb:411:in `call‘
            from /usr/lib/ruby/1.1.0/tsort.rb:411:in `each_strongly_connected_component_from‘
            from /usr/lib/ruby/1.1.0/tsort.rb:347:in `block in each_strongly_connected_component‘
            from /usr/lib/ruby/1.1.0/tsort.rb:345:in `each‘
            from /usr/lib/ruby/1.1.0/tsort.rb:345:in `call‘
            from /usr/lib/ruby/1.1.0/tsort.rb:345:in `each_strongly_connected_component‘
            from /usr/lib/ruby/1.1.0/tsort.rb:224:in `tsort_each‘
            from /usr/lib/ruby/1.1.0/tsort.rb:205:in `tsort_each‘
            from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers‘
            from /usr/lib/ruby/vendor_ruby/rails/application.rb:300:in `initialize!‘
            from /usr/share/redmine/config/environment.rb:14:in `<top (required)>‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `block in require‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:232:in `load_dependency‘
            from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:247:in `require‘
            from /usr/share/redmine/config.ru:3:in `block in <main>‘
            from /usr/lib/ruby/vendor_ruby/rack/builder.rb:55:in `instance_eval‘
            from /usr/lib/ruby/vendor_ruby/rack/builder.rb:55:in `initialize‘
            from /usr/share/redmine/config.ru:in `new‘
            from /usr/share/redmine/config.ru:in `<main>‘
            from /usr/lib/ruby/vendor_ruby/rack/builder.rb:49:in `eval‘
            from /usr/lib/ruby/vendor_ruby/rack/builder.rb:49:in `new_from_string‘
            from /usr/lib/ruby/vendor_ruby/rack/builder.rb:40:in `parse_file‘
            from /usr/lib/ruby/vendor_ruby/rack/server.rb:277:in `build_app_and_options_from_config‘
            from /usr/lib/ruby/vendor_ruby/rack/server.rb:199:in `app‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/server.rb:50:in `app‘
            from /usr/lib/ruby/vendor_ruby/rack/server.rb:314:in `wrapped_app‘
            from /usr/lib/ruby/vendor_ruby/rack/server.rb:250:in `start‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/server.rb:69:in `start‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:81:in `block in server‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:76:in `tap‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:76:in `server‘
            from /usr/lib/ruby/vendor_ruby/rails/commands/commands_tasks.rb:40:in `run_command!‘
            from /usr/lib/ruby/vendor_ruby/rails/commands.rb:17:in `<top (required)>‘
            from /usr/share/redmine/bin/rails:4:in `require‘
            from /usr/share/redmine/bin/rails:4:in `<main>‘

    [1]+  Exit 1                  ruby /usr/share/redmine/bin/rails server -p3000 webrick -e production

三、解决办法:
    修改数据库root密码。
时间: 2024-12-29 16:58:08

Redmine 数据库连接错误的相关文章

Java数据库连接错误集

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. 小问题,遇到了就总结了一下. 出现问题原因: 是 在获取数据库连接的代码关闭了连接  如下代码: try{ if(conn != null){ conn.close(); } }catch(Exception e){ e.printStackTrace(); } 解

android jdbc 数据库连接错误解决方案

今天用Eclipse突然在控制台出现如下错误,没有办法运行程序: [plain] view plaincopyprint? Invalid layout of java.lang.String at value A fatal error has been detected by the Java Runtime Environment: Internal Error (javaClasses.cpp:129), pid=15238, tid=140306591237888 fatal erro

数据库连接错误响应码

1.远程连接数据库提示这个错误 解决方法:远程数据库端口号被修改了

数据库连接错误

vs 在运行web应用程序显示 "未启用当前数据库的 SQL Server Service Broker,因此查询通知不受支持.如果希望使用通知,请为此数据库启用 Service Broker."如下图: 产看其他博主的博客,尝试了一下,结果问题解决了. 解决方案:  执行一段 sql 脚本就好了 /* Databasename   数据库的名字 */ALTER DATABASE DatabaseName SET NEW_BROKER WITH ROLLBACK IMMEDIATE;

数据库连接错误:CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

学习Spring整合Hibernate的知识,新建一个工程,代码结构如下: 按如下步骤整合: 代码如下: hibernate.cfg.xml: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE hibernate-configuration PUBLIC 3 "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 4 "

java项目使用mvn打包时,出现数据库连接错误

原因: maven在install的时候会默认去执行test包下的test示例,导致打包失败,只需要把测试注释掉就可以了包括类上的注解,或者在install的时候跳过测试,install -Dmaven.test.skip=true 重新输入:mvn install -Dmaven.test.skip=true 打包成功! 原文地址:https://www.cnblogs.com/mufengforward/p/10408541.html

数据库连接失败时,如何捕捉错误,避免弹出错误提示,以便下次自动重新连接

主要是要避免人工介入.一旦弹出错误提示,如果没有人工介入把它关掉,则程序会一直停在那里,无法自动重新连接. 在连接的时候虽然加入了try....except保护,但还是无法避免在操作数据库中数据时网络连接突然断掉或数据库服务被关闭时弹出错误提示. 曾经看到过可以在Application的某个事件中进行处理,但现在检索不到 LZ说的那个事件是Applicataion.OnException,程序所有错误都会触发这个事件 一个系统和数据库连接的代码可能有很多,又存在于不同的单元 每个open/exc

从头开始安装redmine项目管理软件

redmine是采用ruby语言基于rails架构写的一款稳定高性能项目管理服务器,这里记录一下完整的安装过程. 注意:所有的操作都在普通用户中进行,不要使用root用户,如果需要高级别权限可以sudo命令执行. 第一步:安装RVM软件,参考链接:http://www.rvm.io/ RVM称作Ruby Version Management,用于管理RUBY的版本功能,可以实现自动安装.可以输入rvm回车查看支持的命令,rvm list known 可以查看当前支持的版本.[[email pro

Entity Framework Code First数据库连接

参考页面: http://www.yuanjiaocheng.net/entity/entitytypes.html http://www.yuanjiaocheng.net/entity/entity-relations.html http://www.yuanjiaocheng.net/entity/entity-lifecycle.html http://www.yuanjiaocheng.net/entity/code-first.html http://www.yuanjiaochen