Home  >  Article  >  Database  >  How to create a database in mysql?

How to create a database in mysql?

藏色散人
藏色散人Original
2019-05-20 13:30:2358023browse

How to create a database in mysql?

How to build a mysql database?

1. Download mysql, install it, then open cmd and cd to the location of mysql directory, and then enter mysqld to start the mysql server

2. View all current databases: show databases;

3. Create a database: create database database name; (The test_db database is created here, and then Use the 1 command to view all databases)

4,

How to create a database in mysql?

Now the database is created, the next step is to create the database table, for example, we create it in test_db A table for tb_user, which contains the fields email, password

5. Switch the current database to test_db

Command use test_db;

6、

How to create a database in mysql?

7. Create table TB_USER. After the creation is successful, use show tables to see if the table is created successfully.

8.

How to create a database in mysql?

##Related learning recommendations:

mysql database

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

Statement:
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