DEV Community

Aashutosh Poudel
Aashutosh Poudel

Posted on

3 2

Some useful MySQL/MariaDB commands to create and provide access to a database.

Login to MariaDB with:

mysql.exe -u root -p <your-root-password>
Enter fullscreen mode Exit fullscreen mode

If your root account doesn't have a password omit the -p option.

Create database with:

create database database_name;
Enter fullscreen mode Exit fullscreen mode

Grant all access to the user with:

grant all on database_name.* to 'root'@'localhost';
Enter fullscreen mode Exit fullscreen mode

If you are logged in with a different user change root to your username accordingly.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay