Home > Database > Mysql Tutorial > How to build a database in mysql

How to build a database in mysql

coldplay.xixi
Release: 2020-08-25 11:06:00
Original
4451 people have browsed it

Mysql database creation method: first install and download mysql, and open cmd; then enter mysqld to start the mysql server; then view all current databases; finally create the database, the code is [create database database name;].

How to build a database in mysql

【Related learning recommendations: mysql learning

Mysql database creation method:

1. Download mysql, install it, then open cmd, cd to the directory where mysql is located, 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)

How to build a database in mysql

4. The database has been created here. The next step is to create a database table. For example, we create a table for tb_user in test_db. The table contains the fields email and password.

Switch the current database to test_db

Command use test_db;

How to build a database in mysql

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

How to build a database in mysql

The above is the detailed content of How to build a database 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