in reply to connect to DBD::MYSQL
Did you try to replace localhost with 127.0.0.1?
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?
# create table (name char(20));
CREATE USER 'test_user'@'localhost';
GRANT ALL PRIVILEGES ON * . * TO 'test_user'@'localhost';
select * from ttt;
1. Keep it simple
2. Just remember to pull out 3 in the morning
3. A good puzzle will wake me up
Many. I like to torture myself
0. Socks just get in the way
Results (6 votes). Check out past polls.