Exception code:
luasql = require("luasql.mysql");
Exception information:
lua: error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.3/luasql/mysql.so':
dlopen(/usr/local/lib/lua/5.3/luasql/mysql.so, 6): Library not loaded: libmysqlclient.18.dylib
Referenced from: /usr/local/lib/lua/5.3/luasql/mysql.so
Reason: image not found
stack traceback:
[C]: in ?
[C]: in function 'require'
/Users/daxuan/Documents/LuaWorkspace/22.Lua db.lua:5: in main chunk
[C]: in ?
[Finished in 0.0s with exit code 1]
[cmd: ['lua', '/Users/daxuan/Documents/LuaWorkspace/22.Lua db.lua']]
[dir: /Users/daxuan/Documents/LuaWorkspace]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin]
Solution:
1. First find the location of libmysqlclient.18.dylib file in mysql, and then create a file link through ln command
2. The specific order is as follows
ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
3. Done!
Similar Posts:
- [Solved] libmysqlclient.so.16: cannot open shared object file: No such file or directory Error
- Merfish error: error 1 libgrid.dylib not found [How to Solve]
- Mac Python3 Conda Pytorch Error: libc++abi.dylib: terminating with uncaught exception of type NSException
- EnvironmentError: mysql_config not found
- MERFISH Error: Error4 Library not load.md [How to Solve]
- Mysqldump: command not found [How to Solve]
- When installing Python mysqlclient, “oserror: MySQL” appears_ “Config not found” error
- C++ Project Error: C Undefined symbols for architecture x86_64: “char_width(char)”
- [Solved] Clang: error: linker command failed with exit code 1
- Ubuntu 16.04 troubleshooting MySQL error [How to Solve]