Table of Contents
Access User Accounts in phpMyAdmin
Create a New User
Edit or Change User Privileges
Delete a User
Advanced: Manage Users via SQL (Alternative Method)
Security Tips
Home Database phpMyAdmin How to manage user accounts in phpMyAdmin

How to manage user accounts in phpMyAdmin

Aug 05, 2025 am 09:22 AM
User Management

Access the User accounts tab in phpMyAdmin using an admin account to manage MySQL users. 2. Create a new user by clicking "Add user account", setting a username, host, strong password, and assigning minimal necessary privileges. 3. Edit existing users by selecting "Edit privileges", modifying passwords or permissions, and clicking "Go" to save. 4. Delete a user by selecting the user, choosing "Drop user" from the "With selected" dropdown, and confirming the action. 5. Optionally, use the SQL tab to run commands like CREATE USER, GRANT, and FLUSH PRIVILEGES for advanced control. 6. Follow security best practices: avoid root for apps, use strong passwords, restrict host access, review accounts regularly, and keep phpMyAdmin updated to ensure database security.

How to manage user accounts in phpMyAdmin

Managing user accounts in phpMyAdmin involves working with MySQL user privileges through a web interface. While phpMyAdmin doesn't have a dedicated "user management" tab like some database tools, you can still create, edit, and delete users and assign permissions using its built-in features. Here’s how to do it properly and securely.

How to manage user accounts in phpMyAdmin

Access User Accounts in phpMyAdmin

  1. Log in to phpMyAdmin with an account that has administrative privileges (like root or a user with GRANT and SUPER permissions).
  2. Click on the "User accounts" tab (in most installations, this is located in the top menu bar).
    • If you're using a shared hosting environment, this tab might be hidden or restricted.

This page shows a list of existing MySQL users and their hosts, along with basic privileges.


Create a New User

To add a new user:

How to manage user accounts in phpMyAdmin
  1. On the User accounts page, click "Add user account".
  2. Fill in the following:
    • Login Information:
      • User name: Enter a username (e.g., webapp_user).
      • Host: Choose or type the host. Common options:
        • localhost – only accessible from the same server.
        • % – allows connection from any host (less secure).
        • Specific IP or domain (e.g., 192.168.1.100).
      • Password: Set a strong password (use the password generator if available).
    • Database for user: Optionally, select "Create database with same name and grant all privileges" to automatically link a database.
  3. Under Global privileges, choose the appropriate access level:
    • Usage – no privileges.
    • All privileges – full access (not recommended for regular users).
    • Or select specific privileges like SELECT, INSERT, UPDATE, DELETE, etc.
  4. Click "Go" to create the user.

Best Practice: Grant only the minimum required privileges. For example, a read-only app user should only have SELECT.


Edit or Change User Privileges

To modify an existing user:

How to manage user accounts in phpMyAdmin
  1. Go to the User accounts page.
  2. Find the user in the list and click Edit privileges (pencil icon).
  3. You can:
    • Change the password under the Change password section.
    • Adjust global privileges.
    • Modify database-specific privileges (e.g., grant access only to mydb).
  4. After making changes, click "Go" to save.

You can also use the "Check privileges" link to see exactly what a user can do.


Delete a User

To remove a user:

  1. On the User accounts page, check the box next to the user(s) you want to delete.
  2. From the "With selected:" dropdown, choose "Revoke all active privileges" first (optional, but safe).
  3. Then choose "Drop user" and confirm.

⚠️ Warning: Dropping a user removes them completely from the MySQL user table.


Advanced: Manage Users via SQL (Alternative Method)

If the GUI is limited, you can use the SQL tab to run MySQL commands directly:

-- Create user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'strongpassword';

-- Grant privileges
GRANT SELECT, INSERT, UPDATE ON mydb.* TO 'newuser'@'localhost';

-- Apply changes
FLUSH PRIVILEGES;

Replace 'localhost' with '%' if remote access is needed (but be cautious).


Security Tips

  • Avoid using root for web applications.
  • Use strong, unique passwords.
  • Limit host access (prefer localhost unless remote DB access is required).
  • Regularly review user accounts and remove unused ones.
  • Keep phpMyAdmin updated to prevent vulnerabilities.

Managing user accounts in phpMyAdmin is straightforward once you know where to look. Just remember: privilege control is key to database security.

Basically, stick to the User accounts tab, grant minimal necessary permissions, and avoid wildcards unless absolutely needed.

The above is the detailed content of How to manage user accounts in phpMyAdmin. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1600
276
How to implement permission control and user management in uniapp How to implement permission control and user management in uniapp Oct 20, 2023 am 11:15 AM

How to implement permission control and user management in uniapp With the development of mobile applications, permission control and user management have become an important part of application development. In uniapp, we can use some practical methods to implement these two functions and improve the security and user experience of the application. This article will introduce how to implement permission control and user management in uniapp, and provide some specific code examples for reference. 1. Permission Control Permission control refers to setting different operating permissions for different users or user groups in an application to protect the application.

User management and permission control in Laravel: implementing multiple users and role assignments User management and permission control in Laravel: implementing multiple users and role assignments Aug 12, 2023 pm 02:57 PM

User management and permission control in Laravel: Implementing multi-user and role assignment Introduction: In modern web applications, user management and permission control are one of the very important functions. Laravel, as a popular PHP framework, provides powerful and flexible tools to implement permission control for multiple users and role assignments. This article will introduce how to implement user management and permission control functions in Laravel, and provide relevant code examples. 1. Installation and configuration First, implement user management in Laravel

How to design an efficient MySQL table structure to implement user management functions? How to design an efficient MySQL table structure to implement user management functions? Oct 31, 2023 am 11:16 AM

How to design an efficient MySQL table structure to implement user management functions? In order to implement the user management function, we need to design a user table in the database to store user-related information, such as user name, password, email, etc. The following will gradually introduce how to design an efficient MySQL table structure to implement user management functions. 1. Create a user table First, we need to create a user table to store user related information. In MySQL, you can use the CREATETABLE statement to create a table, as follows: CREATE

How to develop simple user management functions using PHP How to develop simple user management functions using PHP Sep 20, 2023 am 11:33 AM

How to use PHP to develop simple user management functions requires specific code examples. In modern website development, user management functions are a very basic and common function. Whether it is a social media, e-commerce or blogging website, a user management system is an essential part. This article will introduce how to use PHP to develop a simple user management function and provide specific code examples. First, we need to create a database to store user information. Suppose our database is named "user_management", in

Adding Users to MySQL: The Complete Tutorial Adding Users to MySQL: The Complete Tutorial May 12, 2025 am 12:14 AM

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

How to use MySQL user rights management to protect database security How to use MySQL user rights management to protect database security Aug 03, 2023 pm 06:01 PM

How to use MySQL user rights management to protect database security Introduction MySQL is a widely used open source relational database management system. In order to protect the security of the database, MySQL provides user rights management functions. By properly setting user permissions, security control of the database can be achieved to prevent malicious operations and illegal access. This article will introduce how to use MySQL's user rights management to protect the security of the database, and provide code examples for demonstration. Create users and authorization. First, log in to MyS using the root account.

How to use Python to implement the user management function of CMS system How to use Python to implement the user management function of CMS system Aug 08, 2023 pm 03:03 PM

How to use Python to implement the user management function of a CMS system. With the rapid development of the Internet and information technology, content management systems (CMS) have become the core of many websites. A stable and reliable CMS system can not only help website administrators manage content efficiently, but also provide good user management functions. This article will introduce how to use Python to implement the user management function of the CMS system, and attach corresponding code examples. Preparation Before starting, we need to install Python and related

Manage Linux users: list all users Manage Linux users: list all users Feb 26, 2024 pm 06:27 PM

Linux user management: View all users, specific code examples are required In Linux systems, user management is an important part of system management. Understanding and viewing all users is one of the essential operations. This article will introduce how to view all users and provide specific code examples. To view all users, you can use the following methods: Use the cat command to view the /etc/passwd file. In Linux systems, all user information is saved in the /etc/passwd file. we can make

See all articles