Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^3: connect to DBD::MYSQL

by Tux (Monsignor)
on Jan 31, 2014 at 21:26 UTC ( #1072917=note: print w/ replies, xml ) Need Help??

in reply to Re^2: connect to DBD::MYSQL
in thread connect to DBD::MYSQL

Did you try to replace localhost with

edit (added question): Is the error really 'Unknown MYSQL server host ' localhost' <11004>', as in '<space>localhost? Could it be your code is not actually what you pasted, and the is a space before $hostname?

Enjoy, Have FUN! H.Merijn

Comment on Re^3: connect to DBD::MYSQL
Select or Download Code
Replies are listed 'Best First'.
Re^4: connect to DBD::MYSQL
by fionbarr (Friar) on Feb 01, 2014 at 16:43 UTC
    the code is identical, i.e. NO space before 'localhost' tried with get failed: access denied for user 'test_user'@'localhost' I am doing this and still doesn't work
    use test; # create table (name char(20)); CREATE USER 'test_user'@'localhost'; GRANT ALL PRIVILEGES ON * . * TO 'test_user'@'localhost'; select * from ttt;
    seems like the 'user' does not have access privileges. Any ideas?
      "...Any ideas?"

      Not really. Did you try SHOW GRANTS FOR 'test_user'@'localhost'; (..assuming you can connect via mysql client)? I know, i guess...but don't we do that every day?

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072917]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-11-30 20:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (782 votes), past polls