1 log in to MySQL2Mysql-h Localhost-uroot-P3 4 authorizing the specified user to access the specified database5GRANT all on cookbook.* to'Cbuser'@'localhost'Identified by'Cbpass';6 7 Create a database8 CREATE DATABASE Cookbook;9 Ten Working with Databases One Use Cookbook A - exporting tables and their data in a database -Mysqldump-h localhost-p-u cbuser Cookbook >Cookbook.sql the The entire database is backed up as SQL and can be done when the amount of data is small - - execute an external SQL script -SOURCE ~/Cookbook.sql + executing the source command requires that you have logged in to the database - +Mysql-uroot-p-D Cookbook <Cookbook.sql A this way, you can execute an external script without logging in to the database at - saves the executed SQL to the specified file -MySQL--Tee=tmp.out Cookbok -You do not need to enter a user name and password because you have specified a login username and password
MySQL Common client commands