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 is the related operation of mysql?

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

Share

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

This article will explain in detail how the relevant operations of mysql are. The content of the article is of high quality. Therefore, Xiaobian shares it with you for reference. I hope you have a certain understanding of relevant knowledge after reading this article.

I. Mysql user password modification

There are many ways to modify mysql passwords, including using the mysqladmin command and modifying them on the mysql command line, as follows:

1.# mysqladmin -u USERNAME -h HOSTNAME password 'NEW_PASS' -p2.mysql>SET PASSWORD FO 'USERNAME'@'HOST'=PASSWORD('NEW_PASS')3.UPDATE mysql.user SET PASSWORD=PASSWORD('NEW_PASS') WHERE CONDITION;

Mysql related tools include:

Client: mysql, mysqladmin, mysqldump, mysqlimport, mysqlcheck

Server: mysqld, mysqld_safe, mysqld_multi

III. Related Use of Mysqldump Command

1. mysqldump --user [USER NAME] --password=[PASSWORD] [DATABASE NAME] > [DUMP FILE] or mysqldump -u[USER NAME] -p[PASSWORD] [DATABASE NAME] > [DUMP FILE] Example: mysqldump --user root --password=myrootpassword db_test > db_test.sql or mysqldump -uroot -p password db_test > db_test.sql 2. Backup multiple databases mysqldump -u[USER NAME] -p[PASSWORD] [DATABASE NAME1] [DATABASE NAME2].. > [DUMP FILE] Example: mysqldump --user root --password=password db_frist db_second db_third > db_test.sql 3. Backup all databases mysqldump -u[USER NAME] -p[PASSWORD] --all-databases > [DUMP FILE] 4. Backup a table mysqldump -u[USER NAME] -p[PASSWORD] [DATABASE NAME] [TABLE NAME] > [DUMP FILE] Examples: mysqldump --user root --password=password db_test customers > db_test_customers.sql 5. 6. Backup all table structures of a database mysqldump -u[USER NAME] -p [PASSWORD] -d [DATABASE NAME] > [DUMP FILE] 7. Restore database mysql -u [USER NMAE]-p=[PASSWORD] [DATABASE NAME] < [DUMP FILE] Example: mysql --user root --password=myrootpassword new_db < db_test.sql About mysql related operations is how to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

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