Under Windows, if your MySQL is installed in D:\MySQL, you can do this:
1. First switch to its bin directory
cd D:\MySQL\bin\
D:\MySQL\bin>mysql -u root -p
2. Then enter your root password
Then you can create a database, create a user, create and modify tables and other operations (common commands are as follows).
3. View the existing database
mysql> show databases;
mysql Create a database (if the database is named mydb)
mysql> create database mydb;
Delete the database (if the database is named mydb )
mysql> drop database accounts;
Use database (if using database mydb)
mysql> use mydb;
After executing the use database command, you can create, modify, insert, and delete tables in the database Wait for operations. 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 the detailed content of How to create a new database in mysql?. For more information, please follow other related articles on the PHP Chinese website!