---
title: "Discussion on \"MySQL - Create user, database and set permissions\" | Hashnode"
description: "Discussion on \"MySQL - Create user, database and set permissions\". Login in MySQL mysql -u root -p\nCreate the database:\nCREATE DATABASE mydbname;\nCreate a new user (only with local access) and grant privileges to this user on the new database.\nIf your stack ships MySQL v8.x:\n  mysql> create user 'USER_NAME'@'localho..."
url: "https://hashnode.com/posts/mysql-create-user-database-and-set-permissions/609d1a0147373d4cb0560d46"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [MySQL - Create user, database and set permissions](https://glk.hashnode.dev/mysql-create-user-database-and-set-permissions?utm_source=hashnode&utm_medium=feed)

Login in MySQL mysql -u root -p Create the database: CREATE DATABASE mydbname; Create a new user (only with local access) and grant privileges to this user on the new database. If your stack ships MySQL v8.x: mysql> create user 'USER\_NAME'@'localho...

May 13, 2021 · 1 min read · glk.hashnode.dev  
Read the article

-   [#server-hosting](https://hashnode.com/tag/server-hosting)
-   [#mysql](https://hashnode.com/tag/mysql)

## Written by

[Gopal Kildoliya](https://hashnode.com/@glk)

@glk

  
[View profile](https://hashnode.com/@glk)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
