How to create a read-only MySQL user?

<p>First, login as a MySQL administrator from your terminal / command prompt using the following command:</p> <pre> mysql -u root -p</pre> <p>You&rsquo;ll prompted to enter the password. Type the password for the&nbsp;<code>root</code>&nbsp;account.</p> <p>Create a new MySQL user account.</p> <pre> CREATE USER &#39;report&#39;@&#39;%&#39; IDENTIFIED BY &#39;secret&#39;;</pre> <p>The&nbsp;<code>%</code>&nbsp;in the command above means that user&nbsp;<code>report</code>&nbsp;can be used to connect from any host. You can limit the access by defining the host from where the user can connect. Omitting this information will only allow the user to connect from the same machine.</p> <p><a href="https://medium.com/@nkaurelien/how-to-create-a-read-only-mysql-user-226e8e49a855"><strong>Visit Now</strong></a></p>
Tags: MySQL User