# Problem starting MySQL



## gamesquat (Sep 14, 2016)

Hi All,
I have a problem starting MySQL, (5.7.13_1). From my err.log

```
Shared object "liblz4.so.1" not found, required by "mysqld"
```

Bit of background, this was an old FreeBSD 9.x server that I updated to 10.2 some time ago. I recently upgraded MySQL, all went fine at the time. Was forced to reboot yesterday and the problem appeared.

Attempted fixes: I installed liblz4, (`portmaster -dwv liblz4`). Then deinstalled and reinstalled again, (`make deinstall`, `make reinstall`). Checked for liblz4.so.1, (exists /usr/local/lib/liblz4.so.1). Made sure that /usr/local/lib was a library path, (it was but added ldconfig_paths="/usr/local/lib" to rc.conf then run `/etc/rc.d/ldconfig start`, to make sure).

Tried with both my custom and the default my.cnf files and made sure the permissions were correct, 644 from memory. Still broken.

Any help much appreciated!

```
ELF ldconfig path: /lib /usr/lib /usr/local/lib /usr/local/lib/compat /usr/local/lib/compat/pkg /usr/local/lib/mysql /usr/local/lib/mysql/plugin /usr/local/lib/perl5/5.22/mach/CORE /usr/local/llvm37/lib
32-bit compatibility ldconfig path: /usr/lib32 /usr/local/lib32/compat
```
Versions:

```
mysql57-client-5.7.13_1        Multithreaded SQL database (client)
mysql57-server-5.7.13_1        Multithreaded SQL database (server)
```


```
uname -a
FreeBSD dev08.localdomain 10.2-RELEASE-p18 FreeBSD 10.2-RELEASE-p18 #0: Sat May 28 08:53:43 UTC 2016     [email]root@amd64-builder.daemonology.net[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## SirDice (Sep 14, 2016)

Did you rebuild MySQL _after_ you updated/reinstalled liblz4?


----------



## gamesquat (Sep 14, 2016)

Yep. Tried many things, the latest was to nuke liblz4, (pkg delete -R), which took MySQL with it and then reinstalled MySQL, which installed liblz4 as a dependancy. Have since reinstalled all liblz4's dependancies. But will take your advice and reinstall MySQL once more for my sanity.


----------



## SirDice (Sep 14, 2016)

Before you do remove that ldconfig line from /etc/rc.conf, it shouldn't be needed and may cause problems later on.


----------



## gamesquat (Sep 14, 2016)

Yer, it was late and I was grasping at straws!


----------



## gamesquat (Sep 14, 2016)

Ok, made doubly sure liblz4 and its dependancies were up-to-date, then reinstalled MySQL, and got the same err:

```
2016-09-14T11:38:15.6NZ mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
Shared object "liblz4.so.1" not found, required by "mysqld"
2016-09-14T11:38:15.6NZ mysqld_safe mysqld from pid file /var/db/mysql/dev08.localdomain.pid ended
```


----------

