I need to write a C or C++ program that connects to a MySQL server and displays the global timezone.
Is there any connector needed for doing this? I think mysql.h
header file should be included for doing this. Is that right?
If you have to use C/C++, then yes, you need to use a C or C++ connector to query the server.
SELECT @@global.time_zone, @@session.time_zone;
If this is all you want to do, it is much easier to do it in a shell script, Ruby, Python, php, or a myriad of other scripting languages.
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.