I installed mysql / apache and php. It is all working fine but now I want to use mysql calls in C programs. Therefore I need mysql-devel. Can't find it.

  • 1
  • 1
    The easiest way to find stuff like this is apt-cache search mysql | grep "-dev". – goldilocks Jun 21 '15 at 19:10
  • pi@raspberrypi ~ $ apt-cache search mysql | grep "-dev" grep: invalid argument 'ev' for '--directories' This is the result after a test with copy / past. Looks as if the -d is interpreted as directory. – Ed Buzzi Jun 22 '15 at 21:01
  • 1
    Oh yeah -- sorry. Doesn't work with single quotes either, which makes sense since either way it is just a string passed through. Anyway, you can escape it with a slash: grep "\-dev" (tested). – goldilocks Jun 23 '15 at 11:29

MySql libs are split into client and server in apt...

Try: sudo apt-get install libmysqlclient-dev libmysqld-dev

  • I installed both libs. When I compile my program, mysql.h is still missing. Where should header files be (which directory)? Where are are for instance the standard C header files? I have them since compilation of a simple program using stdio.h compiles fine. As you can see .. newbe ... grrrrr – Ed Buzzi Jun 23 '15 at 11:26
  • Try apt-file search mysql.h (you may have to install apt-file first). In this case I think what you are looking for is libmysqlclient-dev. – goldilocks Jun 23 '15 at 11:32
  • All, did install the libraries but no change. Search for mysql-h was empty (did an update) . I'm afread I have to compile and install the mysql connector/C directly from the MYSQL website. – Ed Buzzi Jun 23 '15 at 12:15
  • It's part of libmysqlclient.dev. (it's just not included in the standard search path...) See this post - stackoverflow.com/questions/14604228/mysql-h-file-cant-be-found – alphacharlie Jun 23 '15 at 22:05
  • All, after the installation of the two libraries : libmysqlclient-dev libmysqld-dev I used the instruction as explaned .. see link cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html and whaaaw .. the C program with SQL "calls" compiles nicely. Thank you all for your input and help. – Ed Buzzi Jun 24 '15 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.