<p>adding <code>-lmysqlclient</code> under <code>LIBS</code> in <code>configure.ac</code> did the trick<br>
the new line reads as follows:</p>

<p><code>
LIBS="$LIBS_TEMP  -lmysqlclient"
</code></p>

CC BY-SA 3.0
2017-11-23T19:35:22.693Z
2017-11-23T19:35:22.693Z
Albert S
<p>I am modifying bitcoind (working with 0.13.1) to include write the log to mysql db versus the log file. 
I have all the functions worked out and compiling outside of bitcoind    </p>

<p>The trouble I ran into is when trying to compile it all with bitcoind.<br>
i added my new file (.cpp and .h) into the makefile and linked <code>-lmysqlclient</code>, but im getting<br>
<code>undefined reference to 'mysql_init'</code>     </p>

<p>any pointers would be appreciated</p>

<bitcoind><compiling><make><mysql>
modifying bitcoind to include mysql support
Albert S
# modifying bitcoind to include mysql support

(Asked by: username_0 on 2017-11-22)

I am modifying bitcoind (working with 0.13.1) to include write the log to mysql db versus the log file.
I have all the functions worked out and compiling outside of bitcoind

The trouble I ran into is when trying to compile it all with bitcoind.  
i added my new file (.cpp and .h) into the makefile and linked `-lmysqlclient`, but im getting  
`undefined reference to 'mysql_init'`

any pointers would be appreciated

**Tags:** bitcoind, compiling, make, mysql


---

## 1 answers

### Answer by username_0 on 2017-11-23. Score: 1 | Accepted answer

adding `-lmysqlclient` under `LIBS` in `configure.ac` did the trick  
the new line reads as follows:

`LIBS="$LIBS_TEMP -lmysqlclient"`


---

