Home > Database > Mysql Tutorial > How to create a new MySQL database in Linux

How to create a new MySQL database in Linux

WBOY
Release: 2023-05-30 18:22:06
forward
2162 people have browsed it

How to create a new MySQL database in Linux

First log in to MySQL

 mysql -u root -p
 //之后输入自己的root密码
Copy after login

Create a new database mynewdatabase

 create database mynewdatabase;
 //注意别漏了“;”分号哦
Copy after login

Create a new database now Created a database mynewdatabase

Let’s check it out:

 show databases;
Copy after login

In the list you can find the database named mynewdatabase you just created

If you want to delete the database, you can use the command:

 drop database mynewdatabase;
 //删除名为mynewdatabase的数据库
Copy after login

To summarize:

 //创建数据库
 create database [database name];
 //查看数据库
 show databases;
 //删除数据库
 drop database [database name];
Copy after login

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

Related labels:
source:yisu.com
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