The CREATE USER statement creates new MySQL accounts. An error occurs for accounts that already exist. To use this statement, you must have the global CREATE USER privilege or the INSERT privilege for the mysql database. For each account, CREATE USER creates a new row in the mysql.user table with no privileges. Depending on the syntax used, CREATE USER may also assign the account a password.
Each user_specification clause consists of an account name and information about how authentication occurs for clients that use the account. This part of CREATE USER syntax is shared with GRANT, so the description here applies to GRANT as well.
Each account name uses the format described in Section 6.2.3, “Specifying Account Names”. For example:
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
If you specify only the user name part of the account name, a host name part of '%' is used.
CREATE USER examples:
To enable the user to connect with no password, include no IDENTIFIED BY clause:
CREATE USER 'jeffrey'@'localhost';
To assign a password, use IDENTIFIED BY with the literal plaintext password value:
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
To avoid specifying the plaintext password if you know its hash value (the value that PASSWORD() would return for the password), specify the hash value preceded by the keyword PASSWORD:
CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';
For additional information about setting passwords, see Section 6.3.5, “Assigning Account Passwords”.
Important
CREATE USER may be recorded in server logs or on the client side in a history file such as ~/.mysql_history, which means that cleartext passwords may be read by anyone having read access to that information. For information about password logging in the server logs, see Section 6.1.2.3, “Passwords and Logging”. For similar information about client-side logging, see Section 4.5.1.3, “mysql Logging”.
Important
Some releases of MySQL introduce changes to the structure of the grant tables to add new privileges or features. To make sure that you can take advantage of any new capabilities, update your grant tables to have the current structure whenever you update to a new version of MySQL. See Section 4.4.8, “mysql_upgrade — Check and Upgrade MySQL Tables”.
Previous / Next / Up / Table of Contents
The CREATE USER statement creates new MySQL accounts. An error occurs for accounts that already exist. To use this statement, you must have the global CREATE USER privilege or the INSERT privilege for the mysql database. For each account, CREATE USER creates a new row in the mysql.user table with no privileges. Depending on the syntax used, CREATE USER may also assign the account a password.
Each user_specification clause consists of an account name and information about how authentication occurs for clients that use the account. This part of CREATE USER syntax is shared with GRANT, so the description here applies to GRANT as well.
Each account name uses the format described in Section 6.2.3, “Specifying Account Names”. For example:
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
If you specify only the user name part of the account name, a host name part of '%' is used.
CREATE USER examples:
To enable the user to connect with no password, include no IDENTIFIED BY clause:
CREATE USER 'jeffrey'@'localhost';
To assign a password, use IDENTIFIED BY with the literal plaintext password value:
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
To avoid specifying the plaintext password if you know its hash value (the value that PASSWORD() would return for the password), specify the hash value preceded by the keyword PASSWORD:
CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';
For additional information about setting passwords, see Section 6.3.5, “Assigning Account Passwords”.
Important
CREATE USER may be recorded in server logs or on the client side in a history file such as ~/.mysql_history, which means that cleartext passwords may be read by anyone having read access to that information. For information about password logging in the server logs, see Section 6.1.2.3, “Passwords and Logging”. For similar information about client-side logging, see Section 4.5.1.3, “mysql Logging”.
Important
Some releases of MySQL introduce changes to the structure of the grant tables to add new privileges or features. To make sure that you can take advantage of any new capabilities, update your grant tables to have the current structure whenever you update to a new version of MySQL. See Section 4.4.8, “mysql_upgrade — Check and Upgrade MySQL Tables”.
Previous / Next / Up / Table of Contents
การแปล กรุณารอสักครู่..
The CREATE USER statement creates new MySQL accounts. An error occurs for accounts that already exist. To use this statement, you must have the global CREATE USER privilege or the INSERT privilege for the mysql database. For each account, CREATE USER creates a new row in the mysql.user table with no privileges. Depending on the syntax used, CREATE USER may also assign the account a password.
Each user_specification clause consists of an account name and information about how authentication occurs for clients that use the account. This part of CREATE USER syntax is shared with GRANT, so the description here applies to GRANT as well.
Each account name uses the format described in Section 6.2.3, “Specifying Account Names”. For example:
สร้างผู้ใช้ ' เจฟฟรี่ ' @ 'localhost ' ระบุ ' mypass ' ;
ถ้าคุณระบุเพียงส่วนหนึ่งของชื่อผู้ใช้ชื่อบัญชี ชื่อโฮสต์เป็นส่วนหนึ่งของ ' % ' ใช้
สร้างตัวอย่างผู้ใช้ :
เพื่อให้ผู้ใช้สามารถเชื่อมต่อกับไม่มีรหัสผ่าน รวมถึงไม่ระบุข้อ :
สร้างผู้ใช้ ' เจฟฟรี่ ' @ 'localhost ' ;
เพื่อกำหนดรหัสผ่าน ใช้รหัสผ่านอักขระอักษรระบุด้วยค่า :
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';
To avoid specifying the plaintext password if you know its hash value (the value that PASSWORD() would return for the password), specify the hash value preceded by the keyword PASSWORD:
CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';
For additional information about setting passwords, see Section 6.3.5, “Assigning Account Passwords”.
Important
CREATE USER may be recorded in server logs or on the client side in a history file such as ~/.mysql_history, which means that cleartext passwords may be read by anyone having read access to that information. For information about password logging in the server logs, see Section 6.1.2.3, “Passwords and Logging”.สำหรับข้อมูลเกี่ยวกับการบันทึกลูกค้าที่คล้ายกัน ดูมาตรา 4.5.1.3 " MySQL การเข้าสู่ระบบที่สำคัญ "
บางรุ่นของ MySQL แนะนำการเปลี่ยนแปลงโครงสร้างของตารางเพื่อเพิ่มสิทธิพิเศษให้ใหม่หรือคุณลักษณะ เพื่อให้แน่ใจว่า คุณสามารถใช้ประโยชน์จากความสามารถใหม่ๆ อัพเดทตารางให้ของคุณมีโครงสร้างปัจจุบัน เมื่อใดก็ตามที่คุณอัพเดทเป็นเวอร์ชันใหม่ของ MySQL ดูมาตรา 44.8 " mysql_upgrade - ตรวจสอบและปรับตาราง " MySQL
ก่อนหน้า / ถัดไป / สารบัญ
การแปล กรุณารอสักครู่..