Greets,
I'm having some trouble connecting to MySQL DB with DBI.
This is the part that giving me trouble:
-------------------------------------------------------------------------------------------------------------------
require '/usr/local/midgard/etc/config.pl
$dbh = DBI->connect("dbi:mysql:$DBNAME" . ";mysql_socket=/var/run/mysql/mysql.sock",
$DBUSER, $DBPASSWD { PrintError => 1, RaiseError => 1, AutoCommit => 1 }} || die
"can't connect to $DBNAME: $DBI::errstr";
-------------------------------------------------------------------------------------------------------------------
The error I'm getting is this:
-----------------------------------------------------------------------------------------------------------------
DBI ->connect(midgard;mysql_socket=/var/run/mysql/mysql.sock) failed: Acces denied for
user: 'midgard@localhost' (Using password:NO) at downgrade_unnaproved.pl line 51
-----------------------------------------------------------------------------------------------------------------
I can connect manually to the DB (midgard) with the user: midgard@localhost without
any problem (password is needed).
The password $DBPASSWD is correct and exist. I did test it with
print "$DPASSWD " . $DBPASSWD ."\n";
This will show me the correct password. Why is DBI not trying to connect with a
password (Using password: NO)?
/var/run/mysql/mysql.sock is owned by mysql:mysql permisions (srwxrwxrwx)
Hope you can help me.
Killaz