MySQL - Create Database User with Password

access_time 19 days ago visibility6 comment 0

Code snippet

The following code snippet creates a user named 'hive' with password ('hive') that never expires.

CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive' password expire never;

Grant permissions

The following SQL statement grants all permission to user 'hive':

GRANT ALL ON *.* TO 'hive'@'localhost';
copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn or Twitter.

Want to publish your article on Kontext?

Learn more

More from Kontext

visibility 6
thumb_up 0
access_time 19 days ago

Checking MySQL version can be done easily via mysql CLI or using SQL. $ mysql -V mysql Ver 14.14 Distrib 5.7.32, for Linux (x86_64) using EditLine wrapper We can either get it from database server variables or using version() function. mysql> show variables LIKE ...

visibility 4
thumb_up 0
access_time 16 days ago

To start MySQL service on a UNIX-alike system or on Windows Subsystem for Linux (WSL), simply run the following command: sudo service mysql start The output looks like the following: * Starting MySQL database server mysqld ...

visibility 6
thumb_up 0
access_time 10 days ago

After installed MySQL server on Windows Subsystem for Linux (WSL, distro Ubuntu-18.04), the following command failed: sudo service mysql start Looking into the log file ' /var/log/mysql/error.log ', it shows the following error: 2021-01-05T10:50:42.322149Z 0 [Note] Server hostname ...

About column

Code snippets and tips for various programming languages/frameworks.