Get the App
SLTechnology News&Howtos  ›  Development  › 

Connect, read, write and manipulate mysql database instances with shell scripts

Shulou Source: shulou.com Published: 2022-06-03 13:09:34 11月14日 Update

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

Tags: Data code database file output space statement script content password quotation mark array method user instance special comma face delimiter readability Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Docker Xiaomi Microsoft