我试图在装有SQL Server Express 2008 R2的服务器上安装redmine,我已经安装了ruby和rails但是在尝试创建数据库结构时我已经停止了,特别是在这一步:
rake db:migrate RAILS_ENV=production
rake aborted!
Unable to connect: Adaptive Server is unavailable or does not exist
使用以下命令在SSMS中创建数据库:
USE [master]
GO
-- Very basic DB creation
CREATE DATABASE [REDMINE]
GO
-- Creation of a login with SQL Server login/password authentication and no password expiration policy
CREATE LOGIN [REDMINE] WITH PASSWORD=N'redminepassword', DEFAULT_DATABASE=[REDMINE], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
-- User creation using previously created login authentication
USE [REDMINE]
GO
CREATE USER [REDMINE] FOR LOGIN [REDMINE]
GO
-- User permissions set via roles
EXEC sp_addrolemember N'db_datareader', N'REDMINE'
GO
EXEC sp_addrolemember N'db_datawriter', N'REDMINE'
GO
我的databse.yml文件如下:
production:
adapter: sqlserver
database: REDMINE
host: localhost
username: REDMINE
password: redminepassword
我有一个数据库,其中包含相应的名称和登录信息,以及有关问题的任何想法?
答案 0 :(得分:2)
决定使用3rd party installation bundle使用MySQL后端而不是SQL Server,就像魅力一样。故事的道德:SQL Server + Redmine + Windows Server =泪流满面。
答案 1 :(得分:1)
这是我的环境信息:
bundle show activerecord-sqlserver-adapter
/opt/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-sqlserver-adapter-4.2.6
bundle show tiny_tds
/opt/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/tiny_tds-0.6.2
每次我对配置文件进行微小更改时,都会运行:
RAILS_ENV=production bundle install --without development test --without development test
当我尝试执行db:migrate时,我收到一个tinyTDS错误:
RAILS_ENV=production bundle exec rake db:migrate
/opt/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
rake aborted!
TinyTds::Error: Unable to connect: Adaptive Server is unavailable or does not exist
关于配置的第一件事是,你必须将config / database.yml指向监听器IP,而不指向sql server数据库。
production:
adapter: sqlserver
database: redmine
host: listener.mysqlserver.myorg.com
username: redmine
password: mypass
使用TCPDump,您还可以检查数据库是否为您的redmine实例提供了答案:
tcpdump -i eth0 | grep listener.mysqlserver.myorg.com
两种方式都必须有流量。否则会因超时而导致:数据库配置,网络路由,用户,密码......
答案 2 :(得分:0)
对于SQL Express,我必须使用host
的IP地址并更改port
。
在database.yaml中有这样的东西:
production:
adapter: sqlserver
database: REDMINE
host: 192.168.0.20
username: REDMINE
password: hot-dang-47-balls!
port: 63151
您的IP地址和端口可能有所不同。在此处检查:SQL Server配置管理器> SQL Server网络配置> SQLEXPRESS的协议> TCPIP(属性)。
答案 3 :(得分:0)
检查事项:
最后这里是适合我的配置文件:
production:
adapter: sqlserver
host: 'WIN10'
#instance: SSE2K14
port: 53540
database: redmine
username: REDMINE1 # should match the database user name
password: "redminepassword" # should match the login password