Programming :: Write A Program That Interacts With MySql In C
Mar 28, 2011
Im trying to write a program that interacts with MySql in C . Im using slackware 13.1 64 bit and Ive installed MySql , getting help from this page : [URL] .
This is the program I have ( I know they arent any vars here , i just thought it wasnt necessary )
This program is from the MySql website ( a tutorial they have up there ). When I run this program I get hundreds of lines of errors , nothing related to my program , but the headers, indicating that there are syntax errors and all kinds of other problems in them.
I have the following problem. I call a C++ program from a Java servlet by using Runtime exec. The OS is ubuntu and I use Netbeans 7.0 with Glassfish 3.1 web server.The program executes but it does not open and write into a specified file in a specified folder. The same C++ program compiled under Windows opens and writes this file.How can I solve this problem in Linux?
My company manufactures satellite TV receiveing equipment. Out current software is quite long and and a bit of an annoyance for customers. I would like the help of a programmer to create for us a customised, easy to use GUI, built to our specification.
I have a kernel module program which is used to create a entry in the proc file system. I have to read and write values in the entry. Its taken from a online tutorial stuff.how to write the value to the proc entry in the program ?
I am using Ubuntu 9.04 linux 2.6.28-11-generic. When I write a program that gives the "Segmentation fault" error, or when I send this signal (SIGSEGV) to a program, the "Segmentation fault" is shown and no core dumped. When I look for "core" file in the current directory, I can't find it, too.
I want to write a program in C which will generate a maze randomly and find the solution for it ..
The idea behind is in [url]
How the 16 bit integer is stored in a variable..Earlier I wrote a program on trees and displayed it using dotty.. Is there any such tool to display a maze..I am using ubuntu 10.04.
write a C program to detect whether the Ethernet cable is plugged or unplugged. I found out by using a command "nm-tool" in Linux terminal will show me whether a Ethernet cable is plugged or not. If Ethernet cable is plugged, in the device part of eth0, the Hardware Link of Wired Settings will indicate a "yes" and "no" if no Ethernet cable. Hence, in my previous code, I use one function called popen to read the state as shown below:
PHP Code:
[code]....
However, now my project wish to not use the NetworkManager (where the "nm-tool" command comes from). And this gives me trouble to detect the Ethernet cable. So is there any other method for me to detect the Ethernet cable in C programming?
i tried a code to accept a character and print the same ! i can accept it with following code but its not working with printing that character i use NASM version 2.07
Code:
segment .data msg1: db 'Enter a key',10 msg1len: equ $-msg1
i am trying to write a program which will read input from a text file, check if each line contains any alphabets and then display a message imforming me if there is an alphabet in each line. My text file is formatted in this way...
I want to write a small program that shows some stockquotes and indexes etc on the desktop. Does anyone know how to get the quotes from google, yahoo etc? Do I rip it from the webpages or is there some other way?
I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):
#!/bin/sh
clear echo "this is before the write command" write jcummins this message should go to jerry echo "the message didn't send and this string will not appear" echo "it appears it has stopped at the write command"
I have a diction(english-bulgarian-english) program which have only windows version and I installed it in my slackware trough wine. The problem is that I can't write a word in bulgarian into it. When in english layout i can write, but when change to bulgarian i can't. I click in the field for the words but just can't.Can be the problem from my system locale, because some programs in bulgarian can't be translated and I see symbols. Help
At work, we run Windows... Windows domain, windows workstations, etc. Today my boss asked me my thoughts on running an Ubuntu lab within the mixture of our existing Windows setup.
Well, that brought several questions to mind. So I understand you can bind an Ubuntu computer to a Windows domain, seems easy enough, whether you do it through Samba or the other guide I read that I kind of forget at the moment, but anyway...
I was just curious how Ubuntu interacts with domain users when on the windows domain. For example, if we have an Ubuntu machine on the Windows domain with a local user "administrator" and that's it, would any domain users be able to log into the Ubuntu work station, similar to how it is on Windows?
I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
I've developed a tiny webserver for home automation out of an ALIX 1D, and based on a debian lenny. It runs very smoothly and is now able to operate quite a lot of different equipment from a webapp. But i'm not sure how I should handle the compact flash, regarding read/write limitations. From what I've read the partitioning should be ext2, which would disallow the journalisation of the system. A utility to 'flatten' the repartition of write cycles exists, would it be relevant to use if the partition is ext2 ?
I will also disable all logging in execution mode (a debug mode will provide the logs). Is there any other parameters I have to take into account for maximum reliability (i.e. does the system randomly write in some files for various and potentially turned off purposes)? As for the mysql database, it's not important data, and it's actually reconstructed every time the server boots. Given this, is there a way to store the db in RAM rather than in a file? I'm not sure it's the right place to ask, but I sometimes see redirection to here from stack overflow.
I'm a noob in Ubuntu. I need the program which will help me to learn different ubuntu commands. I often forget them and after reinstall I don't want to search them in Google. Now I write them in the standard text editor and my code looks like this:
I just have a quick question. I was following a Snort setup guide and it told me to do apt-get install snort-mysql. I just wanted to understand the functionality of such a command where you specify a program and then do a -mysql (snort-mysql). Does this configure an SQL database for that specific application or what?
I want to learn some details about linux booting, so I begin writing a small boot program myself. Yesterday, I was writing a small boot program and planned to use it boot a Bochs virtual machine. The boot program is written in assembly language and compiled with nasm.I use bxiamge.exe in Bochs and create an floppy image called boot.img and configure the Bochs virtual host to boot from this floppy image. My question is how to write the compiled boot.bin program into the floppy image(boot.img)?
I'm interested in finding out, specifically, what causes daemon's to be shutdown when I shutdown Ubuntu? I'm use Ubuntu which is why I'm posting here, but I suppose this knowledge could apply to other Disto's too. Perhaps I'm better off to explain with an example:
I wrote a C++ that queries a Mysql database. I want it to run every time the computer is shutdown. I've verified the program works fine, and I've verified that I can run a program on shutdown of the computer by putting it in /etc/rc0.d. The problem is that by the time rc0.d runs my program, mysql has already been shutoff, and it can't connect.
So what I'm wondering is, is there a script or something at a higher level that goes around turning things like daemons as the System shutdowns, but before any of the scripts in rc0.d are run? (It doesn't look like anything in here is shutting down mysql). Something that actually calls mysql shutdown? How I can add my program to be run before mysql shuts down.
Otherwise, I might end up having to get the source code compile by own /sbin/shutdown and tweak it from there. Granted I might end up doing this anyway because there's more stuff I want to customize during shutdown (e.g. abort it under certain conditions), but I'm hoping not to go that far just yet.
I wrote a code in C to connect to MySQL by using mysql_real_connect function but I recieved error "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" (by using mysql_error function).
I also did the following things: in mysql I typed 'SHOW VARIABLES LIKE '%SOCKET%'', it returned /var/lib/mysql/mysql.sock I typed 'mysql_config --socket' in shell, it returned /var/lib/mysql/mysql.sock I modified /etc/my.cnf file
I'm using a program called Auto Power on and Shut down on Windows. It let's me set times for the computer to shutdown, power on, hibernate, sleep, and etc. Is there any program or any script you can write for Ubuntu that lets you do this? I need something like: Tell computer to turn off at 10am. *run programs* Tell computer to (does Linux have hibernate?) something that isn't shutdown but looks like it's shutdown at 5pm. I use hibernate in Windows.
I have updated my Ubuntu installation to natty narwhale and after a reboot the desktop started to look like the attachment Screenshot.jpgThe error does not appear when I choose ubuntu classic instead the windows miss the top bar where the X (close button) is placed.Alt+Tab does not work, and suddenly I cannot write in the active program.