This article uses examples to describe the commonly used commands for getting started with the basics of MySQL database. Share with you for your reference, the details are as follows: Continued from the previous article: Practical process of master-slave synchronization of MySQL database Introduction to mysql commandsmysql is a database management command Use mysql --help to view related parameters and usage instructions mysql --help #mysql database management command Usage: mysql [OPTIONS] [database] #Syntax format --help #View help document --auto-rehash #Auto-completion function -A, --no-auto-rehash #No need for automatic completion -B, --batch #Do not use history file, disable interaction --character-sets-dir=name #Character set installation directory -C, --compress #Compression when the client and server transmit information-#--debug[=#] #Call function -D, --database=name #Use database --default-character-set=name #Set the default character set -e, --execute=name #Execute sql statement -E, --vertical #Vertical print output information -f, --force #Skip the error and execute the following command -G, --named-commands #Print the query results by column -i, --ignore-spaces #Ignore spaces -h, --host=name #Set the address and IP of the connection server --line-numbers #Show the line number with error -L, --skip-line-numbers #Ignore the line number with error -n, --unbuffered #Refresh the cache after each SQL execution --column-names #Display column information when querying -N, --skip-column-names #Do not display column information -p, --password[=name] #Enter password information -P, --port=# #Set port information --prompt=name #Set mysql prompt --protocol=name #Set the usage protocol -s, --silent # Output line by line, tab interval -S, --socket=name #Connect to the server using socket file -t, --table #Output in table format -u, --user=name #Username to connect to the server -v, --verbose #Print the command executed by sql -V, --version #Output version information -w, --wait #Time to wait for the server to restart after shutdown --connect-timeout=# #Time to wait before connecting --max-allowed-packet=# #The maximum length of packets sent and received by the server --show-warnings #Display warning message Introduction to mysqldump commandmysqldump data backup command (logical backup) This is one of the most frequently used commands in daily life. It is also a commonly used database backup command in small and medium-sized enterprises or when the amount of data is not large. It is very practical. mysqldump --help #mysql database backup command (logical backup) Usage: mysqldump [OPTIONS] database [tables] mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] mysqldump [OPTIONS] --all-databases [OPTIONS] #Backup command format --print-defaults #Print the default program parameter list --no-defaults #Do not output default option parameters --defaults-file=# #Set the specified option parameter file -A, --all-databases #All databases --add-drop-database #Add the drop database statement before creating data --add-locks #Add lock tables before exporting each table and unlock tables afterwards --character-sets-dir #Character set file directory --compact #Export less output information -B --databases #Specify database --debug-info # Output debugging information and exit --default-character-set #Set the default character set, the default is utf8 --dump-slave #Append the main binlog location and file name to the exported data file --events,-E #Backup event information --flush-logs,-F #Refresh log after backup -p, --password[=name] #Connect to database password -P, --port=# #Set port information -S, --socket=name #Connect to the server using the socket file -V, --version #Output version information -u, --user=name #Username to connect to the server Introduction to the mysqlbinlog commandmysqlbinlog is a command used to view binlog binary log file information. It is also one of the frequently used commands in daily life and is usually used when restoring database data. mysqlbinlog --help #View the information recorded in mysql binlog log file Usage: mysqlbinlog [options] log-files #Syntax format --character-sets-dir=name #Specify the character set file directory -d, --database=name #View the log file of the specified database -h, --host=name #View the log file on the specified host --start-position=953 #Starting pos point --stop-position=1437 #End pos point --start-datetime= #Starting time point --stop-datetime= #End time point --database= #Specify to restore only the database Readers who are interested in more MySQL-related content can check out the following topics on this site: "MySQL query skills", "MySQL common functions summary", "MySQL log operation skills", "MySQL transaction operation skills summary", "MySQL stored procedure skills" and "MySQL database lock related skills summary" I hope this article will be helpful to everyone's MySQL database design. You may also be interested in:
|
<<: Learn the operating mechanism of jsBridge in one article
>>: Vue implements adding watermark effect to the page
Table of contents 01 Scenario Analysis 02 Operati...
1. MySQL transaction concept MySQL transactions a...
Preface Currently, the front-end solves cross-dom...
Table of contents Preface What are asynchronous i...
Table of contents 1. Container service update and...
1. Previous versions yum remove docker docker-cli...
Elastic stack, commonly known as ELK stack, is a ...
Table of contents this Method In the object Hidde...
Correspondence between flutter and css in shadow ...
1.core file When a Segmentation fault (core dumpe...
Table of contents JavaScript events: Commonly use...
Preface When the system space usage is too large ...
JSONObject is just a data structure, which can be...
I installed node to the D drive, and I also neede...
The MySQL version number is 5.7.28. Table A has 3...