September 5, 2020

Create a Read Only MySQL User

Activities, Android Developer, Ansible, Apache2, Atlassian, Ayo Belajar Linux, Bestpath Network, BLC Telkom Klaten, BSD, Caddy Server, Case Study, Cisco, Cisco Indonesia, Cloud Computing, Cockpit, Custom Weapons, Docker, E-Learning, Engenius, Error, FreeBSD, FreeBSD Indonesia, Komunitas Pengguna Linux Indonesia, KPLI Bulukumba, KPLI Klaten, Lets Encrypt, Linux, MacOS, Microsoft Azure, Microsoft SQL Server, MikroTik, MikroTik Indonesia, MySQL, Nginx, Open edX, OpenSID, Others, PHP, phpMyAdmin, PostgreSQL, Proxmox, Python, Redash, Sendy, SSH, Stories, Subnetting, TP-Link, Ubiquiti, Unix, Virtualization, Windows, X-Mosque, Faizar Septiawan, Icar, siBunglonGanteng, Orang Ganteng, siBunglonLabs, Programmer, SysAdmin, Site Reliability Engineer, Developer, Palugada, Makassar, Ganteng, Gila, Cyclist, Panglima, Setan, Panglima Setan, sibunglon, Ganteng

There are times when you need account read only access to a database.

To create a read only database user MySQL, do the following steps:

  1. Login as a MySQL administrator.

  2. Create a new MySQL user account.

>>> CREATE USER 'dapenda'@'%' IDENTIFIED BY 'mypassword';
  1. Grant the SELECT only privilege to user.
>>> GRANT SELECT ON site.* TO 'dapenda'@'%';
  1. Reload grant privilege for re-read access table MySQL.
>>> FLUSH PRIVILEGES;
  1. Done.