Home > Database > Mysql Tutorial > What is the command to create and open a database in mysql?

What is the command to create and open a database in mysql?

hzc
Release: 2020-06-12 16:07:28
Original
5705 people have browsed it

What is the command to create and open a database in mysql?

What is the command for mysql to create and open a database:

1. Create a database

//Create a database and set it up Good encoding format

create DATABASE mydb character set utf8;
Copy after login

//Modify the encoding format of the created database or database table

alter database mydb character set utf8;
alter table t_name convert to character set utf8;
Copy after login

2. Open the newly created database

use 数据库名;
Copy after login

Recommended tutorial: "mysql tutorial

The above is the detailed content of What is the command to create and open 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