Opening Connection Without Password
-
I am trying to open a mySQL connection without a password.
In my home account, I have a file
.my.cnf
In there is the following
[client]
password="MyPassword"As a result, on the command line, I am able to do the following:
mysql -u username
allowing me to login without a password.However, I am having trouble doing this via a QT connection.
I can open the connection as follows:
db.open("username", "MyPassword")
However, leaving the password field as "" does not work.
If I just specify the username, and not password via
db.setUserName("username")
then
db.open();
It still will not work
I get the error:
Access denied for user 'username@localhost' (using password: NO) QMYSQL: Unable to connect
Is there a connection option that exists allowing me to login with password? This is somewhat critical
for my application.
Thanks.