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

What are the common commands of MySQL

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you what the common commands of MySQL are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. Start and stop the MySQL service

(right-click to open the command prompt as an administrator)

Enter the command: net start mysql to start the service

Enter the command: net stop mysql to shut down the service

2. MySQL login and logout 2.0 MySQL parameters

2.1 MySQL login input command parameters: mysql-u root-p

2.2 MySQL exit

Enter parameters:

3. Modify the MySQL prompt

Method 1: specify through parameters when connecting to the client

After we log in to MySQL, the original prompt should be [> mysql], and we change it to [localhost] with the following command

Command line: mysql-uroot-proot-- prompt -\ h

Method 2: after connecting to the client, modify it through the prompt command

Prompt mysql >

At this point, the prompt will change back to [mysql >]

4. Common command

1. Show the current server version

SELECT VERSION ()

two。 Show current date and time

SELECT NOW ()

3. Show current user

SELECT USER ()

5. Specification of MySQL statement

[keywords] and [function] names are all capitalized

[database] name, [table] name, [field] name are all lowercase

The [SQL] statement must end with [;]

The above is all the contents of this article "what are the common commands of MySQL?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Database

Wechat

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

12
Report