In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about the functions related to MySQL database management, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
Here are the functions related to learning MySQL database management.
[1] View MySQL version number
[conclusion] you can see the MySQL version number you are using by directly calling the VERSION () function-- without any arguments.
[2] get the current login user name
[conclusion] there are four functions to view the current login MySQL user name.
[3] View the number of connections of logged-in users
[conclusion] the number of connections to the MySQL server can be seen by directly calling the CONNECTION_ID () function-- without any parameters-- and the return value of this function may be different in different periods of time.
[4] View the connection information of the logged in user
Using the "SHOWPROCESSLIST" command, you can see the query results returned by the users who are currently connected to the MySQL service, similar to a table.
Id column: the user ID of the login MySQL, which is the CONNECTIONID automatically assigned by the system
User column: displays the current user name
Host column: displays the IP that executed this statement, which is used to track the user who has the problem statement
Db column: shows which database this process is currently connected to
Command column: displays the commands executed by the current connection, such as Sleep, Query, Connect
Time column: displays the duration of this state in seconds
State column: displays the status of the SQL statement using the current connection, including: Copyingtotmptable, Sortingresult, Sendingdata, etc.
Info column: displays the contents of the current SQL, but may not be fully displayed if the statement is too long.
[5] View the database name that the current user is using
[conclusion] the database name of the current user connection can be queried by using the SCHEMA () function.
[6] get the character set of a string
[conclusion] using the CHARSET () function, you can see that MySQL defaults to the character set of UTF-8.
[7] get the arrangement of strings
[conclusion] the value returned by the COLLATION () function is how the characters are sorted, and we can see this option when we define the MySQL table field.
[8] get the last automatically generated ID value
Use the bbs_user table in the above figure as an example, where the field uID is defined as self-growing.
In the case of no data in the table, you can see that LAST_INSERT_ID () returns a value of 0.
INSERT two pieces of data in the table:
The return value of LAST_INSERT_ID () is 2.
MySQL has a total of 8 types of system information functions, of which 2 types need to transfer parameters, the other 6 types do not need to transfer parameters; mastering the system information functions is helpful to better learn the MySQL database.
After reading the above, do you have any further understanding of the functions related to MySQL database management? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.