I've got the following code seems runnable. it just performs like building a connection with a configurable username and password.
But when I attempt to run it, it returns Access denied as shown below. Anyone got idea on why?Code:# dbConn.rb require "mysql" begin dbname="aDatabase" print "Please enter your user name associating with mysql DB: " uName= gets print "Please enter your password: " pwd= gets m = Mysql.real_connect("localhost",uName,pwd) m.select_db(dbname) result = m.query("SELECT * FROM content") m.close end
george@linux:~/updating> ruby dbConn.rb
Please enter your user name associating with mysql DB: root
Please enter your password: xxxxxx
dbConn.rb:14:in `real_connect': Access denied for user: 'root (Mysql::Error)
@localhost' (Using password: YES) from dbConn.rb:14




Bookmarks