0

[email protected] exists, but still can't connect to local MySQL. It looks like MySQL verifies hostname instead of lo ip(127.0.0.1).

root@castle /v/l/mysql# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.6.22 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select user, host from user where user='root'; +------+-----------+ | user | host | +------+-----------+ | root | 127.0.0.1 | | root | ::1 | | root | castle | | root | localhost | +------+-----------+ 4 rows in set (0.00 sec) mysql> exit; Bye root@castle /v/l/mysql# mysql -u root -h 127.0.0.1 ERROR 1045 (28000): Access denied for user 'root'@'lixxx-yyy.members.linode.com' (using password: NO) 

1 Answer 1

0

Where is it getting "lixxx-yyy.members.linode.com" from? Check you /etc/hosts file.

Try:

host 127.0.0.1 

Expect to see:

1.0.0.127.in-addr.arpa domain name pointer localhost. 

You can add that host to the hosts table to allow root to connect, or try to have "127.0.0.1" resolve to "localhost" as expected.

2
  • Yes, when I run host 127.0.0.1, I get '1.0.0.127.in-addr.arpa domain name pointer localhost. ' The problem is MySQL check my eth0 ip instead of lo ip. Commented Jan 30, 2015 at 14:56
  • host 106.186.xxx.yyy(eth0 ip): yyy.xxx.186.106.in-addr.arpa domain name pointer lixxx-yyy.members.linode.com. host 127.0.0.1: 1.0.0.127.in-addr.arpa domain name pointer localhost. Commented Jan 30, 2015 at 15:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.