Home > Database > Mysql Tutorial > body text

How to create a username in mysql

藏色散人
Release: 2022-06-07 14:33:23
Original
9075 people have browsed it

MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently a product of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is one of the best RDBMS (Relational Database Management System) application software.

How to create a username in mysql

mysql Create user name

1. Log in to mysql database

Execute the mysql -h localhost -u root -p command in the cmd command window and enter the password

How to create a username in mysql

After successful login, enter MySQL initialization interface, the welcome message "Welcome to the MySQL monitor" will appear, as well as some explanatory sentences.

2. Mysql creates user and password

create user 用户名 IDENTIFIED by '用户密码';
Copy after login

Example:

Use CREATE USER to create a user, the username is test1, and the password It is test1, and the host name is localhost. The SQL statement and execution process are as follows.

mysql> CREATE USER 'test1'@'localhost' IDENTIFIED BY 'test1';
Query OK, 1 rows affected (0.06 sec)
Copy after login

The results show that the test1 user was successfully created.

The above is the detailed content of How to create a username in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!