Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jan 30, 2015 11:22 am 
Offline

Joined: Fri Jan 30, 2015 11:13 am
Posts: 1
First, I install MySQL follow this tutorial: https://www.linode.com/docs/databases/mysql/using-mysql-relational-databases-on-ubuntu-14-04-lts-trusty-tahr

Then I connect to MySQL via UNIX Socket, make sure 'root'@'127.0.0.1' exists:

Quote:
mysql> show grants for 'root'@'127.0.0.1';
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@127.0.0.1 |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY PASSWORD '*836E5321B6F5B6371002741B5CA03AC8CEA9418A' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


But when I connect to MySQL via TCP:

Quote:
root@castle /v/l/mysql# mysql -u root -h 127.0.0.1 -p 1
Enter password:
ERROR 1130 (HY000): Host 'castle.abcdefg.org' is not allowed to connect to this MySQL server


'castle.abcdefg.org' is FQDN of this machine. If I create a new user, 'root'@'106.186.125.xyz', connection is ok:

Quote:
root@castle /v/l/mysql# mysql -u root -h 127.0.0.1 -p 1
Enter password:
mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.22, for Linux (x86_64) using EditLine wrapper

Connection id: 7
Current database:
Current user: root@castle.abcdefg.org
SSL: Not in use
Current pager: less
Using outfile: ''
Using delimiter: ;
Server version: 5.6.22 MySQL Community Server (GPL)
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 36 min 0 sec

Threads: 2 Questions: 80 Slow queries: 0 Opens: 87 Flush tables: 1 Open tables: 80 Queries per second avg: 0.037
--------------

mysql> select current_user();
+----------------------+
| current_user() |
+----------------------+
| root@106.186.125.xyz |
+----------------------+
1 row in set (0.00 sec)


So the problem is, when I connect to local MySQL server, MySQL check eth0 ip instead of 127.0.0.1. How does it happen and how to solve this problem?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group