How to create a new database in mysql? -mysql new database tutorial guide

Time: 2022-11-01Source: Huajun Software TutorialAuthor: Shaobing

Friends, do you know how to create a new database in MySQL? Today I will explain the tutorial guide for creating a new database in MySQL. If you are interested, come and take a look with me. I hope it can help you.

79489

Under Windows, if your MySQL is installed in D:MySQL, you can do this:

1. First switch to its bin directory

1

cd D:MySQLbin

1

D:MySQLbin>mysql -u root -p

2. Then enter your root password

Next, you can create databases, create users, create and modify tables and other operations (common commands are as follows).

3. View existing database

1

mysql> show databases;

mysql creates a database (if the database is named mydb)

1

mysql> create database mydb;

Delete the database (if the database is named mydb)

1

mysql> drop database accounts;

Use database (if using database mydb)

1

mysql>use mydb;

After executing the database command, you can create, modify, insert, delete tables and other operations on the database. A database is equivalent to an Excel file, and a table is equivalent to the cells of the Excel file, and the data is stored in the table.

The above is what the editor brings to youmysql new databaseTutorial strategyAll the content, I hope it can help everyone.

Related articles更多>>

Popular recommendations