Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the related operation of mysql?

Shulou Source: shulou.com Published: 2022-05-31 16:09:10 10月03日 Update

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.

Tags: Backup data database examples commands content passwords articles more knowledge articles structures yes including multiple multiple clients clients tools methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia MySQL Huawei vpn