Connect, read, write and manipulate mysql database instances with shell scripts
This article introduces the relevant knowledge of "using shell scripts to connect, read and write, and operate mysql database instances". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Connect to mysql database
The way to connect to a database in shell is simple, just specify the user name, password, and database name of the connection, and then enter the statement of mysql through redirection, as shown below:
The code is as follows:
Mysql-u USERNAME-p PASSWORD DATABASENAME