> For the complete documentation index, see [llms.txt](https://docs-epc.gitbook.io/ncs-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-epc.gitbook.io/ncs-documents/database-as-a-service/sql-database/manage-sql-database-user/create-database-user.md).

# Create Database User

สร้าง Database User สำหรับการใช้งาน Database โดย Database User สามารถกำหนด Username ซ้ำเดิมกับที่ใช้งานอยู่แล้วได้ แต่จะต้องกำหนด Allowed Host ต่างกัน เนื่องจากจะถือเป็นคนละ Database User กันและต้องจัดการสิทธิ์การเข้าถึง Database Schema แยกจากกัน

## Instructions

### 1. เข้าสู่หน้า Database Instances&#x20;

เลือกรายการ “Database Instances” ที่ Sidebar จากเมนู SQL Database

<figure><img src="/files/Lblzkxfhy9Ot424RhfAc" alt=""><figcaption><p>เข้าสู่หน้า Database Instances</p></figcaption></figure>

### 2. เข้า tab Access Management&#x20;

เข้าไปที่หน้า Database Instance Detail ของ Database Instance ที่ต้องการทำคำสั่ง แล้วกดที่ tab Access Management ระบบจะแสดงรายการ Database User

<figure><img src="/files/rvVrhn0fN22HnMFbBiFc" alt=""><figcaption><p>เข้า tab Access Management</p></figcaption></figure>

### 3. เลือกคำสั่ง Create Database User&#x20;

เลือกคำสั่ง Create Database User ได้จากปุ่ม “CREATE” ที่มุมขวาบนของรายการ Database User

<figure><img src="/files/KvDM2tdcwaKau5JZw3CQ" alt=""><figcaption><p>เลือกคำสั่ง Create Database User</p></figcaption></figure>

### 4. กำหนด Username&#x20;

หลังกดปุ่ม “CREATE” ระบบจะแสดงหน้าต่าง หลังจากนั้นกำหนด Username ของ Database User

<figure><img src="/files/cdDkKdF6Zv3JoCb1lg0c" alt=""><figcaption><p>กำหนด Username</p></figcaption></figure>

### 5. กำหนด Allowed Host

กำหนด Host สำหรับการใช้งาน Database User นั้น

<figure><img src="/files/KzoU3S03B41VzLsCP9co" alt=""><figcaption><p>กำหนด Allowed Host</p></figcaption></figure>

### 6. กำหนด Password

กำหนด Password สำหรับการใช้งาน Database User นั้น

<figure><img src="/files/fKxBh6bGKDp9iLMMGnkG" alt=""><figcaption><p>กำหนด Password</p></figcaption></figure>

### 7. เลือก Database Schema ที่เข้าถึงได้&#x20;

เลือก Database Schema ที่ Database User นั้นเข้าถึงได้ และสามารถแก้ไขสิทธิ์ได้ภายหลัง ([ขั้นตอนการ](https://app.gitbook.com/o/b4jKLRni8sRoSESA9D6d/s/q2BYmWTMiaonrEL8QBP2/~/changes/300/database-as-a-service/manage-sql-database-user/edit-access)[ Edit Access](https://app.gitbook.com/o/b4jKLRni8sRoSESA9D6d/s/q2BYmWTMiaonrEL8QBP2/~/changes/300/database-as-a-service/manage-sql-database-user/edit-access)) หลังจากนั้นกดปุ่ม “CREATE” เพื่อทำการ Create Database User

<figure><img src="/files/MS7sCSDrD2OJFJ30Zarw" alt=""><figcaption><p>เลือก Database Schema ที่เข้าถึงได้</p></figcaption></figure>

### 8. Database User จะสามารถใช้งานได้ หลังจากทำคำสั่งสำเร็จ&#x20;

ระบบจะทำการ Create Database User หลังจากนั้นรายการ Database User จะแสดง Database User ที่ได้ทำการสร้าง แสดงว่าคำสั่งสำเร็จ

<figure><img src="/files/4gtuPBBcXPCMrPtA7GfP" alt=""><figcaption><p>Database User ได้ถูกสั่งสร้างสำเร็จ</p></figcaption></figure>
