Managing Database Users
52 vues
Database Management
<h3>Database User Administration</h3>
<p>Database users control access to your MySQL databases. Each user can be assigned specific privileges that determine what operations they can perform. Proper user management is important for both security and functionality.</p>
<h3>Creating a Database User</h3>
<p>A database user is typically created along with a new database. However, you can also create additional users:</p>
<ol>
<li>Log in to DirectAdmin and go to <strong>MySQL Databases</strong>.</li>
<li>Click on the database you want to add a user to.</li>
<li>Look for an option to <strong>Add User</strong> or <strong>Create User</strong>.</li>
<li>Enter the username and password for the new user.</li>
<li>Select the privileges to grant (see below).</li>
<li>Click <strong>Create</strong> or <strong>Save</strong>.</li>
</ol>
<h3>Understanding Database Privileges</h3>
<p>Common MySQL privileges include:</p>
<ul>
<li><strong>SELECT</strong> - Read data from tables.</li>
<li><strong>INSERT</strong> - Add new rows to tables.</li>
<li><strong>UPDATE</strong> - Modify existing data in tables.</li>
<li><strong>DELETE</strong> - Remove rows from tables.</li>
<li><strong>CREATE</strong> - Create new tables and databases.</li>
<li><strong>DROP</strong> - Delete tables and databases.</li>
<li><strong>ALTER</strong> - Modify table structures (add/remove columns).</li>
<li><strong>INDEX</strong> - Create and remove indexes on tables.</li>
<li><strong>ALL PRIVILEGES</strong> - Grants all available privileges.</li>
</ul>
<div class="alert alert-info">For most web applications like WordPress, the database user needs <strong>ALL PRIVILEGES</strong> on its database to function correctly, including for running updates and installing plugins.</div>
<h3>Assigning a User to a Database</h3>
<p>If you have created a user separately from a database, you need to link them:</p>
<ol>
<li>Go to <strong>MySQL Databases</strong> in DirectAdmin.</li>
<li>Select the database.</li>
<li>Choose the user from the available users list.</li>
<li>Select the privileges to grant.</li>
<li>Click <strong>Add User to Database</strong> or <strong>Save</strong>.</li>
</ol>
<h3>Changing a Database User Password</h3>
<ol>
<li>Navigate to <strong>MySQL Databases</strong>.</li>
<li>Find the user in the list and click <strong>Change Password</strong> (or click the user name).</li>
<li>Enter and confirm the new password.</li>
<li>Click <strong>Save</strong>.</li>
</ol>
<div class="alert alert-warning">After changing a database user's password, update the password in all applications that use that database user (e.g., <code>wp-config.php</code> for WordPress). Failing to do so will cause database connection errors on your website.</div>
Besoin d'aide ?
Vous ne trouvez pas ce que vous cherchez ? Notre équipe de support est prête à vous aider.
Contacter le support