Home  >  Article  >  Database  >  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
hzcOriginal
2020-06-12 16:05:065491browse

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;

//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;

2. Open the newly created database

use 数据库名;

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!

Statement:
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