May 24, 2021 That's what Linux should learn
As mentioned earlier, the technical main line of this book is the operation and operation direction of Linux system, will not be in-depth explanation of the operation of the database management system, so we have mastered the above basic database operation commands after enough. The following to explain the database backup and recovery, these knowledge is more practical, I hope you can master.
The mysqldump command is used to back up database data in the format "mysqldump ( Parameters ) ( Database Name ) " . T he parameters are approximately the same as the mysql command, the -u parameter is used to define the account name of the login database, and the -p parameter represents the password prompt. The contents of the linuxprobe database are exported into a file and saved to the root administrator's home directory:
root@linuxprobe mysqldump -u root -p linuxprobe /root/linuxprobeDB.dump Enter password: Enter the password of the root administrator in the database here and enter the MariaDB database management system to completely delete the linuxprobe database, so that the mybook data form will also be completely deleted. Then re-establish the linuxprobe database:
MariaDB [(none)]> DROP DATABASE linuxprobe; Q uery OK, 1 row affected (0.04 sec) MariaDB [(none)]> SHOW databases; + --------------------+ | D atabase | + --------------------+ | i nformation_schema | | m ysql | | p erformance_schema | + --------------------+ 3 rows in set (0.02 sec) MariaDB [(none)]> CREATE DATABASE linuxprobe; Q uery OK, 1 row affected (0.00 sec) next is the moment to witness the effects of data recovery! U se the input redirector to import the database file you just backed up into the mysql command, and then execute the command. N ext, log in to the MariaDB database and you'll see the linuxprobe database and the mybook data form again. Database recovery was successful!
root@linuxprobe -u root -p linuxprobe -lt; /root/linuxprobeDB.dump Enter password: Enter the password value of the root administrator in the database here root@linuxprobe. R eading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [linuxprobe]> SHOW tables; + ----------------------+ | T ables_in_linuxprobe | + ----------------------+ | m ybook | + ----------------------+ 1 row in set (0.05 sec) MariaDB [linuxprobe]> DESCRIBE mybook; + -------+----------+------+-----+---------+-------+ | F ield | T ype | N ull | K ey | D efault | E xtra | + -------+----------+------+-----+---------+-------+ | n ame | c har(15) | Y ES | | N ULL | | | p rice | i nt(11) | Y ES | | N ULL | | | p ages | i nt(11) | Y ES | | N ULL | | +-------+----------+------+-----+---------+-------+ 3 rows in set (0.02 sec)