简体   繁体   中英

Run mysql command in background

Is there any way to run mysql command in background or keep the connection alive for some time where in there can be queries executed on it. Can nohup be used to achieve this? If yes, how?

Yes there are, you can do this with ajax

With Nohup you can do this

mysql -u [username] -p [database_name] -e "[sql_query]"

Example:

nohup mysql -u root -p somedb -e "select * from mytable" &

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM