In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces what mysql tips are, which are introduced in great detail and have certain reference value. Friends who are interested must finish reading them.
1. View historical operation record
1.1 linux operating system view historical operation record
[root@mysql etc] # history
1 cat ~ / .bash.history
2 top
3 cat ~ / .bash.history
.
1.2 mysql database historical operation record
[root@mysql etc] # cat / root/.mysql_history
_ HiStOrY_V2_
Show\ 040tabase
Show\ 040database
two。 To prevent misoperation, modify the mysql prompt.
2.1 temporarily effective (a temporary session takes effect)
Mysql > prompt\ u@andy\ r:\ m:\ s->
PROMPT set to'\ u@andy\ r:\ m:\ s->'
Root@andy 03DV 54VOV 06- >
2.2 permanent effect (add the following under [mysql] module in my.cnf configuration (note, not [mysqld]) after saving, you do not need to restart mysql, exit the current session, and log in again)
[root@mysql etc] # vi / etc/my.cn
-- add to the my.cnf:
[mysql]
Prompt=\\ u@andy\\ r:\ m:\\ s->
3. View the database currently used by mysql.
Mysql > select database ()
+-+
| | database () |
+-+
| | mysql |
+-+
1 row in set (0.00 sec)
4. Output row records output by column
The original format is mysql > select * from user; (the output is messy and inconvenient to view)
After adjusting the format, mysql > select * from user\ G; (output by column, very neat)
* * 1. Row *
Host:%
User: root
Password: * 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
The above is all the content of this article "what are the mysql Tips?" Thank you for reading! Hope to share the content to help you, more related 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.
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.