简体   繁体   中英

Re-directing output of C code as input to MySQL server

I want to compile a C program related to databases in Windows. I have installed MySQL.

What I actually want to do is re-direct the output of my C code as an input command for my database.

I have done this thing in Ubuntu having followed the below given link:

PS Does it require for me to compile the code in Command Prompt (because that's how I access the MySQL server).

How do I do it?

No - you can compile the code anyhow.

If you want to redirect output, it's easiest to make the program a console application (which can be compiled from the IDE or from the command line).

Then you pipe the output of the program to the mysql command line client.

yourprogram | mysql --user=user_name --password=your_password db_name

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