How to log in to MySQL?

To log in to MySQL, you can use the mysql command-line client. Here’s how to do it:

  1. Open your terminal.

  2. Use the following command to log in, replacing username with your MySQL username (e.g., root):

    mysql -u username -p
    
  3. Enter your password when prompted. If you are using the root user, the command would look like this:

    mysql -u root -p
    
  4. After entering the command, you will be prompted to enter the password. Type your password and press Enter.

If the credentials are correct, you will be logged into the MySQL shell, where you can execute SQL commands.

0 Comments

no data
Be the first to share your comment!