Skip to main content

MySQL User Management

Create a User and Define Login Host

To create a new user with access from a specific host or IP address:

Grant Permissions

Grant Specific Permissions

To grant specific permissions on a particular database and table:
Example:

Grant All Privileges

To grant all privileges on all databases and tables:

Update Database Permissions

To refresh the privileges:

Revoke Permissions

To remove a specific permission from a user:

Show User Permissions

To display the permissions granted to a user:

Delete a User

To delete a user from MySQL:

MySQL Database Management

Basic Commands

Clear Console Screen

To clear the console screen in MySQL:

Create a Database

To create a new database:

Change Database

To switch to a different database:

Drop/Delete Database

To delete an existing database:

Show All Databases

To list all databases on the server:

Get Information About a Table

To describe the structure of a table:

Show All Tables

To list all tables in the current database:

Create a New Table

To create a new table with specified columns:

Rename a Table

To change the name of a table:

Add a New Column

To add a new column to a table:

Drop a Column

To remove a column from a table:

Drop a Table

To delete a table:

Show Columns of a Table

To list all columns in a table:

Show Information About a Column

To get information about a specific column:

Delete All Rows in a Table

To delete all rows from a table:

Export and Import Database

Export Database

To back up a database:

Import Database

To restore a database from a backup:

MySQL Server Installation

Install MySQL Server

To install MySQL server on a Linux system:

Secure MySQL Installation

To secure the MySQL installation:

Access MySQL

To enter the MySQL shell as root:
To enter the MySQL shell with a specific user:

Enter a Specific Database

To select and use a specific database:

Help and Commands

To access MySQL help:
This guide provides essential commands and steps for managing MySQL databases, including user management, database operations, and backup/restore procedures.
This documentation covers the necessary commands for managing MySQL users, databases, and backup/restore operations, as well as basic usage of MySQL and related tools.