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 are the common commands of MySQL foundation

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what are the commonly used commands on the basis of MySQL, which are introduced in great detail and have a certain reference value. Friends who are interested must finish reading them!

Introduction to mysql command

Mysql is a database management command

Use mysql-- help to view relevant parameters and instructions for using mysql-- help # mysql Database Management Command Usage: mysql [OPTIONS] [database] # Syntax format-- help # View help documentation-- auto-rehash # automatic completion function-A -- no-auto-rehash # does not need automatic completion-B,-- batch # does not use history files Disable interaction-character-sets-dir=name # character set installation directory-C,-compress # compress when passing messages between client and server-#-debug [= #] # invoke function-D,-- database=name # use database-default-character-set=name # to set the default character set-e -- execute=name # execute sql statement-E,-- vertical # Vertical printout information-f,-- force # Skip error Execute the following command-G,-- named-commands # query results print by column-I,-- ignore-spaces # ignore the space-h,-- host=name # set the address of the connection server and IP--line-numbers # shows the wrong line number-L -- skip-line-numbers # ignores incorrect line numbers-n,-- unbuffered # flushes the cache after each sql execution-- column-names # displays column information-N,-- skip-column-names # does not display column information-p,-- password [= name] # enter password information-P -- port=# # setting port information-- prompt=name # setting mysql prompt-- protocol=name # setting using protocol-- s,-- silent # one-line output Tab interval-S,-- socket=name # connects to the server using the socket file-t,-- table # outputs-u in tabular format,-- user=name # user name of the connection server-v,-- verbose # prints commands executed by sql-V -- version # output version information-w -- time to wait for restart after wait # server downtime-- time to wait before connect-timeout=# # connects-- maximum length of packets sent and received by max-allowed-packet=# # server-- show-warnings # display warning message mysqldump command introduction

Mysqldump data backup command (logical backup)

One of the most frequently used commands in daily life is also a commonly used database backup command for small and medium-sized enterprises or small amounts of data, which 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 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 drop database statements before creating data-- add-locks # add lock tables before each table is exported and after unlock tables--character-sets-dir # character set file directory-- compact # export less output information-- B-- databases# specify database-- debug -info# outputs debugging information and exits-- default-character-set # sets the default character set The default is utf8--dump-slave # to append the primary binlog location and file name to the exported data file-- events,-E # backup event information-- flush-logs,-F # refresh the log after backup-p,-- password [= name] # connection database password-P,-- port=# # set port information-S,-- socket=name # connection server uses socket file-V -- version # output version information-- u,-- user=name # user name mysqlbinlog command introduction to the connection server

Mysqlbinlog is a command used to view binlog binary log file information and is one of the commands that are often used on a daily basis, usually when restoring database data.

Mysqlbinlog-- help # View the information recorded in mysql's binlog log file Usage: mysqlbinlog [options] log-files # Syntax format-- character-sets-dir=name # specified character set file directory-d,-- database=name # View the log file of the specified database-h -- host=name # View log files on the specified host-- start-position=953 # start pos point-- stop-position=1437 # end pos point-- start-datetime= # start time point-- stop-datetime= # end time point-- Database= # specifies that only all the contents of the article "what are the common commands for MySQL basics" above are recovered from the database Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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