Skip navigation links

MySQL Forums :: Ruby :: Host is not allowed to connect to this MySQL server.


Advanced Search

Host is not allowed to connect to this MySQL server.
Posted by: srikanth g ()
Date: September 15, 2009 12:08AM

Hi All,

I have an web application implemented using ruby on rails.And running on one machine(working as a server).

Now i am trying to connect to connec to the database of the server from a host machine.To connect i have written a ruby program which will connect to remote sql database.But i could not able to connect.

And i have installed ruby with mysql suport on my Host.

Below is the ruby program to connect to remote sql database.

------------------------
#!/usr/bin/ruby -w
require "mysql"

begin
# connect to the MySQL server
dbh = Mysql.real_connect("smruti", "root", "", "smruti_production")
# get server version string and display it
puts "Server version: " + dbh.get_server_info
rescue Mysql::Error => e
puts "Error code: #{e.errno}"
puts "Error message: #{e.error}"
puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")
ensure
# disconnect from server
dbh.close if dbh
end

----------------------------
But i am getting error like below:

Error code: 1130
Error message: Host 'X0064167PC' is not allowed to connect to this MySQL server.

Can any one suggets how to overcome this problem.

thanks
Srikanth

Options: ReplyQuote


Subject Written By Posted
Host is not allowed to connect to this MySQL server. srikanth g 09/15/2009 12:08AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.