Debian install mysqldump
This will ask you for the MySQL root password that you set during installation. First, we are asked about the validate password plugin , a plugin that can automatically enforce certain password strength rules for your MySQL users. If enabled, you will also be prompted to choose a level from 0—2 for how strict the password validation will be.
Since we just created the password when we installed MySQL, we can safely skip this. The rest of the prompts can be answered yes. You will be asked about removing the anonymous MySQL user, disallowing remote root login, removing the test database, and reloading privilege tables to ensure the previous changes take effect properly.
These are all a good idea. The script will exit after all the prompts are answered. Now our MySQL installation is reasonably secured. The -u root portion tells mysqladmin to log in as the MySQL root user, -p instructs the client to ask for a password, and version is the actual command we want to run.
The output will let us know what version of the MySQL server is running, its uptime, and some other status information:. For more information about the basics of MySQL, we encourage you to check out the following tutorials:.
Where would you like to share this to? Twitter Reddit Hacker News Facebook. Share link Tutorial share link. Sign Up. DigitalOcean home.
Community Control Panel. Hacktoberfest Contribute to Open Source. Active 2 years, 7 months ago. Viewed 63k times. Improve this question. You must install mysql-client, which is a dependency of mysql-server pastebin. It must be the same version of the server. Thank you Add a comment. Active Oldest Votes. Improve this answer. Kevin Sadler Kevin Sadler 2, 23 23 silver badges 30 30 bronze badges. Impermanence Impermanence 96 4 4 bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Produce output that is more compatible with other database systems or with older MySQL servers. To use several values, separate them by commas. These values have the same meaning as the corresponding options for setting the server SQL mode. This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump output more compatible.
Compress all information sent between the client and the server if both support compression. Use --skip-create-options to disable. Dump several databases. Normally, mysqldump treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names.
Write a debugging log. Print debugging information and memory and CPU usage statistics when the program exits. If no character set is specified, mysqldump uses utf8. Set filename as the file to read default options from after the global defaults files has been read. Must be given as first option.
Set filename as the file to read default options from, override global defaults files. Also read groups with a suffix of str.
This option automatically enables --master-data. This makes loading the dump file faster because the indexes are created after all rows are inserted. If the --comments option is given, mysqldump produces a comment at the end of the dump of the following form:. However, the date causes dump files taken at different times to appear to be different, even if the data are otherwise identical. The default is --dump-date include the date in the comment. Used for producing a dump file from a replication slave server that can be used to set up another slave server with the same master.
Causes the binary log position and filename of the master to be appended to the dumped data output. This option will turn --lock-all-tables on, unless --single-transaction is specified too in which case a global read lock is only taken a short time at the beginning of the dump - don't forget to read about --single-transaction below.
In all cases any action on logs will happen at the exact moment of the dump. Option automatically turns --lock-tables off. Using this option causes mysqldump to stop the slave SQL thread before beginning the dump, and restart it again after completion.
This results in a smaller dump file and speeds up inserts when the file is reloaded. Flush the MariaDB server log files before starting the dump. If you use this option in combination with the --all-databases option, the logs are flushed for each database dumped. The exception is when using --lock-all-tables or --master-data : In this case, the logs are flushed only once, corresponding to the moment that all tables are locked. If you want your dump and the log flush to happen at exactly the same moment, you should use --flush-logs together with either --lock-all-tables or --master-data.
This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration. One use for this option is to cause mysqldump to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped.
Without --force , mysqldump exits with an error message. With --force , mysqldump prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing.
Available from MariaDB The old-style positions are still included in comments when --gtid is used; likewise the GTID position is included in comments even if --gtid is not used. Dump data from the MariaDB server on the given host. The default host is localhost. Do not dump the given table, which must be specified using both the database and table names.
To ignore multiple tables, use this option multiple times. This option also can be used to ignore views. Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically turns off --single-transaction and --lock-tables.
For each dumped database, lock all tables to be dumped before dumping them. For transactional tables such as InnoDB, --single-transaction is a much better option than --lock-tables because it does not need to lock the tables at all.
Because --lock-tables locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states. Log warnings and errors by appending them to the named file.
0コメント