Old Testament readings use the Septuagint , the Scripture the apostles quoted. Masoretic numbering shown for reference.Learn why
KJV

Ecclesiastes 8:2

I counsel thee to keep the king’s commandment, and that in regard of the oath of God.

Read in other translations