How to change the privileges to other host in MySQL?
<p>I have a MySQL user called <code>myname</code>. I configured in <code>.conf</code> file for my project to point to host <code>db</code>: <code>jdbc:mysql://db/db_name</code>(when project run it check the configuration in this file to find path to db). However, the project show me the error: <code>Unknown database 'db_name'</code>(when execute). Then I login to mysql with user <code>myname</code> and check the grants and see that:</p>

<pre><code>    +-----------------------------------------------------+
    | Grants for myname@%                                 |
    +-----------------------------------------------------+
    | GRANT USAGE ON *.* TO 'myname'@'%'                  |
    | GRANT ALL PRIVILEGES ON `db_name`.* TO 'myname'@'%' |
    +-----------------------------------------------------+
</code></pre>

<ul>
<li>I supposed that the host should be <code>myname@db</code> not <code>myname@%</code>, then I can query to <code>db_name</code> without error. If my thought like this is correct, how can I change the privileges to <code>myname@db</code>?</li>
<li>If not, what can I do to solve the error: <code>Unknown database 'db_name'</code>?</li>
</ul>