-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#getting Informix::DatabaseError Incorrect password or user informix@[myservername] is not known on the database server. #6
Comments
Hello @wasimwaqia ! I'm taking a look. |
You can force a specific server when specifying the database, like this: I'm guessing that There are many ways to get the Informix networking setup wrong... Double check Please let me know your findings. |
I see. Let me clarify that the dbservername, if you specify one, should be part of the first argument, the database name, not the user. The correct line should be: db = new('stores@muharram', 'informix', 'informix') Which leads me to think that the Rails adapter is doing it wrong or is misconfigured. What Rails adapter is it? |
Thank you once again, I am using both the activerecord and also ruby-infomix adapters These are the list in the gem file for adding informix connections/adapters My database.yml file has the following config for the adapter informix development: I am also following the instructions in the IBM developers hand book](https://www.redbooks.ibm.com/redbooks/pdfs/sg247884.pdf) from page 361 to 396 I am still new to RoR frame work and am trying to learn things. I guess the server name is being populated from the env variable $INFORMIXSERVER 1st iteration with variable set to muharram 2nd iteration variable set to blank 3rd Iteration the variable set to muharram_odbc 4th iteration setting the variable to some server name example - pronto Thanks a lot |
It looks like there's a mistake in that book. You can see from the source code of the adapter that the def self.informix_connection(config) #:nodoc:
require 'informix' unless self.class.const_defined?(:Informix)
require 'stringio'
config = config.symbolize_keys
database = config[:database].to_s
username = config[:username]
password = config[:password]
db = Informix.connect(database, username, password)
ConnectionAdapters::InformixAdapter.new(db, logger)
end If you need to specify a server, include it in the database name. In this case it would look like this: Can you give that a try in |
I tried the following Output irb setting db = new('stores') irb setting db = new('stores@muharram') irb setting db = new('stores@muharram_odbc') irb setting db = new('stores@muharram_tcp')
irb setting db = new('stores@muharram') 2.b. set the database: stores@muharram_tcp in database.yml file irb setting db = new('stores@muharram_tcp')
2.c. set the database: stores@muharram_odb in database.yml file irb setting db = new ('stores@muharram_odbc)
summary rails adapter within rails server errors with the message Error details - Informix::DatabaseError I am able to run any *.rb files from ruby example i create a ifx_metadata.rb under config directory load the informix driverrequire 'informix' Connect to the databasedb = Informix.connect(ARGV[0]) print database informationprint "Connected to #{db.version}\n" db.columns(ARGV[1]).each { I can run it with ruby ifx_metadata.rb stores state but when i run rails s i get the following error |
According to the error message, the adapter is attaching the server name to the username, which is wrong. This adapter however never does that. Are you sure that's the one you're using? You can try finding that file in Rails and edit it to get more debug information. |
I have now reinstalled the adapter , however i find something strange when i try to read the adapter settings from irb development: when try to query the database.yml configuration in the irb I see some strange output for the variable password I tried even separating the lines password and require
when i do this my query for password in irb returns if i try to alter the adapter settings i get entirely a different error if i change my database.yml as below development:
The error i get goes something like this screenshot below from this my conclusion is that the configuration is reading a wrong password and the possible solution would be to isolate the password parameter value and the require parameter is there a possibility to get the password and the require parameters separated? Thank you |
Indeed, these lines DO NOT belong to the configuration file:
Delete them from the configuration file. |
This code: require 'informix'
db = Informix.connect('stores') is not meant to be included in any configuration file. It is definitely not expected if you are using this Ruby on Rails adapter for Informix: https://github.com/santana/activerecord-informix-adapter I showed above how the configuration file is used, here: https://github.com/santana/activerecord-informix-adapter/blob/9bb3b6dfc59a322a23e1f3e52fb16852c69c3004/lib/active_record/connection_adapters/informix_adapter.rb#L32-L43 No code is expected; only configuration. |
Take in account that this adapter https://github.com/santana/activerecord-informix-adapter is old and it's more likely not compatible with newer versions of Ruby on Rails. |
Hello, I am trying to build a sample app with the stores demo database, I get the error "Informix::DatabaseError
Incorrect password or user informix@[myservername] is not known on the database server."
I am able to connect to the server using irb and query data, however am unable to create any views using the gem 'ruby-informix', '~> 0.8.3'
my database.yml config is
adapter: informix
#server: my_servername
database: stores
username: informix
password: informix
require 'informix'
db=Informix.connect('stores', 'informix', 'informix')
is it possible to force the login with only the username rather than user@servername
I have also checked all my config and I can connect to the server using isql .
Thank you .
The text was updated successfully, but these errors were encountered: