LEENTech Network Solutions Inc.

How can we help you today?

​How do I create a user in MySQL?

Modified on: Wed, Aug 26, 2015 at 3:53 PM

There are two primary steps when creating a MySQL user. The first step is to CREATE a
username and password combination for the user. The second step is to
add the user to the database you want the user to access.

Steps 1. In the "New User" section, ENTER the username and password you want to use for this database in the "Username" and "Password" text boxes, respectively. 2. Next, CLICK on the Create User button. 3. You should see the following statement: * "Added USERNAME with the password PASSWORD." 4. CLICK on the Go Back link. 5. FIND the "Add User To Database" section. SELECT the user you created in Step 6 above from the "User" drop down menu. Then SELECT the database you want to add the user to from the "Database" drop down menu. 6. Next, CLICK on the Submit button.
7. When the page loads you will see a two-column table. The top of the
table provides a checkbox option "ALL PRIVILEGES" allowing you to CREATE the database with all privileges, otherwise you can CHECK each of the items in the two columns that you want to allow for your new database. The options include:

* SELECT (Allows USERNAME to SELECT data from a table in the database.) * INSERT (Allows USERNAME to INSERT data into a table in the database.) * UPDATE (Allows USERNAME to UPDATE data in a table in the database.) * DELETE (Allows USERNAME to DELETE data from a table in the database.) * INDEX (Allows USERNAME to CREATE index on table column in the database. This can speed up a database.) * CREATE TEMPORARY TABLES (Allows USERNAME to CREATE temporary tables in the database.) * CREATE (Allows USERNAME to CREATE tables in the database.) * ALTER (Allows USERNAME to ALTER tables in the database.) * DROP (Allows USERNAME to DROP tables in the database.) * LOCK TABLES (Allows USERNAME to LOCK tables in the database.) * REFERENCES (Allows USERNAME to CREATE references to a table in the database.)

NOTE: Typically you may want to CHECK the "All Privileges" option unless you want specific control over the user you are creating for this database.

8. Assuming you have either checked the "All Privileges" option or a combination of the options in the two columns, CONTINUE the wizard by clicking on the Make Changes button. 9. You should see the following statement: * "User USERNAME was added to the database DATABASE." 10. CLICK on the Go Back link. 11. You should now see the user you created in Step 1 above in the "Users" column.