x

New NFT's Just Minted!

How to create mariadb user and database (or MySQL)

How to Create MariaDB User and Database

Quick Guide on how to Create a User and Database using MariaDB on Linux Ubuntu or similar Debian based Distros.

  1. First we want to log in to MariaDB on a new Terminal window

    • sudo mysql -u root -p

      • Note: Drop the -p option if your root user has no password
  2. Next, simply use the following command, replacing <YOUR_DB> with your database name

    • CREATE DATABASE <YOUR_DB>;

    • You can confirm the database has been created with this command:

    • SHOW DATABASES;

  3. Now, lets create a database User for this new DB

    • CREATE USER <YOUR_USER>@localhost IDENTIFIED BY "<USERS_PASSWORD>";
  4. Now lets grant this user privileges to be able to use ALL databases in their entirety.

    • GRANT ALL PRIVILEGES ON *.* TO <YOUR_USER>@localhost IDENTIFIED BY "<USERS_PASSWORD>";

    • alternatively , if you want the user to only have access to the database you just created, run the following command instead:

    • GRANT ALL PRIVILEGES ON <YOUR_DB>.* TO <YOUR_USER>@localhost;

  5. Finally run the following:

    • FLUSH PRIVILEGES;

Posted by: admin
2023-10-25 14:24:00

© Autonetix.co - All rights reserved | 2022 - 2025

Go To Top 

Our Sites

Autonetix.co CouchCoins.com.au