title: Mysql localhost != 127.0.0.1?
body: <pre><code>$ mysql -u root -h 127.0.0.1 -e 'show tables' created_from_host;
  +-----------------------------+
  | Tables_in_created_from_host |
  +-----------------------------+
  | test                        |
  +-----------------------------+
  
  $ mysql -u root -h localhost -e 'show tables' created_from_host;
  ERROR 1049 (42000): Unknown database 'created_from_host'
  
  $ cat /etc/hosts
  127.0.0.1       localhost.localdomain localhost
  127.0.0.1       localhost
  ::1     localhost6.localdomain6 localhost6
  </code></pre>
  
  <p>How could it be? And main question - <strong>how to grant ALL privileges on ALL databases from ALL hosts for root?</strong> </p>
  
  <p><strong>UPD:</strong></p>
  
  <pre><code>$ mysql -u root -h 127.0.0.1 -pzenoss -e "show grants";
  +----------------------------------------------------------------------------------------------------------------------------------------+
  | Grants for root@localhost                                                                                                              |
  +----------------------------------------------------------------------------------------------------------------------------------------+
  | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*3715D7F2B0C1D26D72357829DF94B81731174B8C' WITH GRANT OPTION |
  | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
  +----------------------------------------------------------------------------------------------------------------------------------------+
  $ mysql -u root -h localhost -pzenoss -e "show grants";
  +----------------------------------------------------------------------------------------------------------------------------------------+
  | Grants for root@localhost                                                                                                              |
  +----------------------------------------------------------------------------------------------------------------------------------------+
  | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*3715D7F2B0C1D26D72357829DF94B81731174B8C' WITH GRANT OPTION |
  | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
  +----------------------------------------------------------------------------------------------------------------------------------------+
  </code></pre>
  
  <p><strong>UPD2:</strong></p>
  
  <pre><code>zends&gt; SHOW GLOBAL VARIABLES LIKE 'skip_networking';
  +-----------------+-------+
  | Variable_name   | Value |
  +-----------------+-------+
  | skip_networking | OFF   |
  +-----------------+-------+
  1 row in set (0.00 sec)
  
  zends&gt; SELECT user,host FROM mysql.user WHERE user='root'; 
  +------+-----------------------+
  | user | host                  |
  +------+-----------------------+
  | root | 127.0.0.1             |
  | root | ::1                   |
  | root | localhost             |
  | root | localhost.localdomain |
  +------+-----------------------+
  4 rows in set (0.00 sec)
  </code></pre>