Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL command line client command

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

(After MySQL is installed and configured)

I. Start or close MySQL service

Start service: net start database service name

Close service: net stop database service name

Note:

If you are already inside mysql-> and cannot use the above two commands, use quit to exit this layer.

The above two commands must be executed under cmd window.

II. Log in to admin system

mysql -u username-p password

Welcome to mysql... Indicates successful database connection

Note: When executing commands under cmd, you do not need a lowercase ";" semicolon at the end of the command line.

III. Create, view, delete, and use databases

Creating a database:

CREATE DATABASE database name DEFAULT CHARSET='utf8';

For example:

Create database student default charset='utf-8';

creating database student default character encoding utf-8

View all databases on this server:

show databases;

Delete database:

Drop database name;

Using a database:

use database name;

Show all the tables in the library:

show tables;

Exit current connection

quit;

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report