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?
print "Please enter your user name associating with mysql DB: "
print "Please enter your password: "
m = Mysql.real_connect("localhost",uName,pwd)
result = m.query("SELECT * FROM content")
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