🧚 주목! Beekeeper Studio는 빠르고 현대적이며 오픈 소스 데이터베이스 GUI입니다 다운로드
June 10, 2024 작성자: Matthew Rathbone

Introduction

To create a new user in MariaDB, you need to have access to the MariaDB server with an account that has sufficient privileges to create new users. If you don’t have such an account, you will need to contact your database administrator to create a user for you.

Assuming you have the necessary privileges, you can create a new user in MariaDB using the following steps:

Connect to MariaDB

You can connect to the MariaDB server using the mysql command-line client, or graphically using Beekeeper Studio. You will need to provide the appropriate username and password for an account that has the necessary privileges.

Execute CREATE USER

Once you are connected to the MariaDB server, use the CREATE USER statement to create a new user. This statement takes the following form:

CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';

Replace username with the desired username for the new user, hostname with the hostname or IP address of the server where the user will be able to connect from, and password with the desired password for the user.

Need a secure password for your database users? Try our free Database Password Generator tool.

Here’s an example which allows user ‘matthew’ to connect from any host.

CREATE USER 'matthew'@'%' IDENTIFIED BY 'supersecretpassword';

Grant Permissions

After creating the user, you will need to grant the necessary privileges to the user. This is done using the GRANT statement, which has the following form:

GRANT priv_type ON priv_level TO 'username'@'hostname';

Replace priv_type with the type of privilege you want to grant (such as SELECT, INSERT, UPDATE, etc.), priv_level with the level at which the privilege should apply (such as a specific database or table), and username and hostname with the values you used in the CREATE USER statement.

You can view all the privileges that the database supports by calling SHOW PRIVILEGES. See the official documentation for more information.

Here is an example of granting ALL permissions on all databases to our user, Matthew:

GRANT ALL PRIVILEGES ON * . * TO 'matthew'@'%';

Flush privileges

After granting the necessary privileges to the user, you can use the FLUSH PRIVILEGES statement to make the changes take effect. This statement has the following form:

FLUSH PRIVILEGES;

That’s It

Once you have completed these steps, the new user will be able to connect to the MariaDB server and perform the actions allowed by the privileges you have granted. It is important to note that you can always use the REVOKE statement to remove privileges from a user or the DROP USER statement to delete the user entirely.

MariaDB CREATE USER Summary

In summary, creating a new user in MariaDB involves using the CREATE USER and GRANT statements to create the user and grant the necessary privileges, and then using the FLUSH PRIVILEGES statement to make the changes take effect. As always, it is important to carefully manage user accounts and privileges to ensure the security and integrity of your MariaDB server.

Beekeeper Studio는 무료 & 오픈 소스 데이터베이스 GUI입니다

제가 사용해 본 최고의 SQL 쿼리 & 편집기 도구입니다. 데이터베이스 관리에 필요한 모든 것을 제공합니다. - ⭐⭐⭐⭐⭐ Mit

Beekeeper Studio는 빠르고 직관적이며 사용하기 쉽습니다. Beekeeper는 많은 데이터베이스를 지원하며 Windows, Mac, Linux에서 훌륭하게 작동합니다.

Beekeeper의 Linux 버전은 100% 완전한 기능을 갖추고 있으며, 기능 타협이 없습니다.

사용자들이 Beekeeper Studio에 대해 말하는 것

★★★★★
"Beekeeper Studio는 제 예전 SQL 워크플로를 완전히 대체했습니다. 빠르고 직관적이며 데이터베이스 작업을 다시 즐겁게 만들어 줍니다."
— Alex K., 데이터베이스 개발자
★★★★★
"많은 데이터베이스 GUI를 사용해 봤지만, Beekeeper는 기능과 단순함 사이의 완벽한 균형을 찾았습니다. 그냥 작동합니다."
— Sarah M., 풀스택 엔지니어

SQL 워크플로를 개선할 준비가 되셨나요?

download 무료 다운로드