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,
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、
7. Create table TB_USER. After the creation is successful, use show tables to see if the table is created successfully.
8.
##Related learning recommendations:
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!