Host is not allowed to connect to this MySQL server.
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