> For the complete documentation index, see [llms.txt](https://7-sadas.gitbook.io/jhcis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://7-sadas.gitbook.io/jhcis/update/mysql-5.6.md).

# ติดตั้ง MySQL 5.6

## ดาวน์โหลดโปรแกรม

สำหรับ windows 64bit

{% embed url="<https://jhcis.moph.go.th/software/mysql-5.6.45-winx64.rar>" %}

สำหรับ windows 32bit

{% embed url="<https://jhcis.moph.go.th/software/mysql-5.6.45-win32.rar>" %}

<figure><img src="/files/ufdybm0OLTBhOmEaaILO" alt=""><figcaption></figcaption></figure>

## ปิดการใช้งาน Service MySQL\_JHCIS

กด Win + R  พิมพ์ "services.msc" กด Enter&#x20;

<figure><img src="/files/xOhVVy2zrIyV9XQ9hyVJ" alt=""><figcaption></figcaption></figure>

หา service ชื่อ MySQL\_JHCIS แล้วคลิกขวาเลือก Stop

คลิกที่ MySQL\_JHCIS อีกครั้ง เลือก Properties

<figure><img src="/files/el1iKNgLXNMFSKbCyY1V" alt=""><figcaption></figcaption></figure>

เปลี่ยน Startup type จาก "Automatic" เป็น "Disable" แล้วกด OK

<figure><img src="/files/vTnS6FucvmbqmWrcI5hQ" alt=""><figcaption></figcaption></figure>

## ติดตั้ง&#x20;

นำ Folder MySQL5.6 มาไว้ที่ "C:\Program Files\JHCIS"

<figure><img src="/files/hG4FRdytS7RH7AqizRAp" alt=""><figcaption></figcaption></figure>

เปิด Command Prompt ด้วยกดปุ่ม Start Windows พิมพ์ "cmd" แล้วคลิก "Run as administrator"

<figure><img src="/files/idoDxBBZm3EElrLZ0qID" alt=""><figcaption></figcaption></figure>

พิมพ์คำสั่งดังนี้

```batch
cd C:\Program Files\JHCIS\MySQL5.6\bin
```

<figure><img src="/files/cqnkPNVr4OPnv5dMrXQ7" alt=""><figcaption></figcaption></figure>

พิมพ์คำสั่งดังนี้ ตามลำดับ

```batch
mysqld --install MySQL56_JHCIS --defaults-file="C:\Program Files\JHCIS\MySQL5.6\my.ini" 
```

```batch
net start MySQL56_JHCIS
```

```batch
mysql -P3333 -uroot
```

```batch
use mysql;
```

```batch
update user set password=password('123456') where user='root';
```

```batch
grant all privileges on *.* to 'root'@'localhost' with grant option;
```

```batch
create user 'root'@'%' identified by '123456';
```

```batch
grant all privileges on *.* to 'root'@'%' with grant option;
```

```batch
flush privileges;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://7-sadas.gitbook.io/jhcis/update/mysql-5.6.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
