Redmine 数据库连接错误

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: /******************************************************************** * Redmine 数据库连接错误 * 说明: * OpenMediaVault上的Redmine出现连接错误,目前不知道是我自己不小心 * 把mysql的密码修改了,还是因为被攻击了,先记录一下。
/********************************************************************
 *                    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

二、错误现象:
    root@workflow:/etc# ruby /usr/share/redmine/bin/rails server -p3000 webrick -e production &
    [1] 2828
    root@workflow:/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密码。

 

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
11月前
|
关系型数据库 MySQL 数据库
MySQL忘记root密码、远程无法连接的解决方法
MySQL忘记root密码、远程无法连接的解决方法
|
关系型数据库 MySQL 数据库连接
忘记 mysql 数据库连接密码(解决方案)
忘记 mysql 数据库连接密码(解决方案)
200 0
|
关系型数据库 MySQL Windows
Windows安装Mysql,服务无法启动,错误1053处理
在Windows7操作系统,部署mysql的时候, 无法启动Mysql服务 错误1053:服务没有及时响应启动或控制请求。 以下整理了处理的详细过程
1485 0
Windows安装Mysql,服务无法启动,错误1053处理
|
关系型数据库 MySQL 数据库
MySQL连接错误,使用Navicat连接MySQL出现访问被拒错误的情况:
MySQL连接错误,使用Navicat连接MySQL出现访问被拒错误的情况:
1313 0
MySQL连接错误,使用Navicat连接MySQL出现访问被拒错误的情况:
|
关系型数据库 MySQL 数据库
Mysql 远程登录1045失败解决办法
Mysql 远程登录1045失败解决办法
271 0
Mysql 远程登录1045失败解决办法
|
关系型数据库 MySQL PHP
PHP连接MySQL 8.0报错的解决办法
PHP连接MySQL 8.0报错的解决办法
531 0
|
关系型数据库 MySQL 数据库连接
关于WordPress建立数据库连接错误的解决方法
自己在调整自己的WordPress网站(APP兼职网)时,刷新页面是突然出现建立数据库连接错误。 按照页面的提示,主要原因可能有几下几种: 1、数据库配置文件被篡改。 2、数据库服务器的问题,服务未启动或者其他的一些数据库故障。
1660 0
关于WordPress建立数据库连接错误的解决方法
|
关系型数据库 MySQL 数据库
MySQL 不允许从远程访问的解决方法
解决方法: 1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。
901 0
|
存储 关系型数据库 MySQL
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。Mysql(针对Mysql5.7版本,其他版本可能略有不同)错误:1045解决方法:以管理员身份运行cmd(win8系统:win+x 键 ,再按 A键 ),进入Mysql安装目录下的bin目录下(如下图所示,根据自己...
2336 0
|
存储 关系型数据库 MySQL
Confluence 6 MySQL 测试你的数据库连接
在你的数据库设置界面,有一个 测试连接(Test connection)按钮可以检查: Confluence 可以连接你的数据库服务器 数据库字符集,隔离级别和存储引擎是正确的 你的数据库用户有正确的数据库权限 一旦上面的测试成功了,单击 下一步(Next )来继续进行 Confluence 的安装进程。
1097 0

热门文章

最新文章

下一篇
oss创建bucket