Generally, when backing up a database, it is not a big problem to directly use phpmyadmin to export and import a smaller database for backup and restore. If the database is large or the integrity may be taken into consideration, it is recommended to use mysqldump And mysql commands to back up and restore the database (refer to: Explain how to use the mysqldump command to backup and restore MySQL data )。 Today, when I backed up a server database of the company“ mysqldump : command not found "Error prompt.
Lao Zuo has never encountered this error before. It is estimated that the system does not find the command file under/usr/bin by default. Here we need to readjust the soft link settings.
First, problems
Second, solve problems
find / -name mysql -print
Find the directory where the mysql software is located.
Here we can see the path of MySQL.
/usr/local/mysql/bin/mysql
Third, set soft links
ln -fs /usr/local/mysql/bin/mysqldump /usr/bin
ln -fs /usr/local/mysql/bin/mysql /usr/bin
After execution, let's try MySQL or mysqldump to restore and back up the database. My test can solve this problem. Finally, if we are not sure about the operation, it is recommended to back up the data before the operation.
Scan the code to follow the official account
Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge