Home > Operation and Maintenance > Linux Operation and Maintenance > Create database and user under centos7

Create database and user under centos7

巴扎黑
Release: 2017-06-23 14:19:52
Original
3850 people have browsed it

First, you need to install mysql under the centos system. I have already installed this, so I will not post the process here.

Step 1: Log in to the mysql database using the root user:

## Step 2: Create a mysql database. When the first step is successful in logging in, the mysql command will appear: mysql>

## Step 3: Create a simple data table in the already created database

Step 4: Create a user for the database and grant permissions

Such a simple database has been created successfully. One thing to note is that after each mysql statement is written, a ; sign must be added, otherwise the statement will not be executed.

Possible errors during this process:

mysql> create database if not exists ipay_db;

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.


After successfully logging into mysql with root, such an error occurred. My solution is:

mysql> SET PASSWORD=PASSWORD('123!');

Query OK, 0 rows affected, 1 warning (0.00 sec)

The above is the detailed content of Create database and user under centos7. 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