MySQLOO Troubles

Hey guys, I am having trouble with this stupid thing.
Couldn’t include file ‘includes\modules\mysqloo.lua’ (File not found)

I have it named gmsv_mysqloo_win32.dll
located in garrysmod/lua/bin

I have libmysql.lua
located in root directory

the place where it is being required is located in addons/addon/lua/autorun/file.lua
in the file it is exactly this >> require(‘mysqloo’) <<

typing lua_run require(‘mysqloo’) in console will return no errors

All help is appreciated, thank you.

Where is the script you are trying to require mysqloo from?

Also, I recommend using tmysql4. It has better performance, reconnects if the MySQL server disconnects and queues everything for you. (But that’s my own opinion :v:)

lua/autorun runs your code shared. Therefore it will attempt to require it on both the server and client The client does not have the MySQLOO module. Wrap it in “if SERVER then” to prevent this from happening.

Also, you shouldn’t be connecting to a MySQL server in any shared file. You can use connections you have created in serverside files, but you shouldn’t be putting in your information. Anyone with a little knowledge can use a tool to decompress their Lua cache and wreak havoc upon your server by dropping tables or adding themself to tables you don’t want them in. Also, you should be using more descriptive file names (not file.lua). That is a name that could easily conflict.

Thank you AK, I appreciate the tips and Ill recode my addon around that basis.

@billyonwiiu
I had attempts with tmysql4 even with the conversion wrapper but it just seems to break gamemodes on my servers. I dont know ill just stick with what works.

You could’ve posted the error, maybe you installed the wrong module or so/installed the wrapper wrong? tmysql4 works fine for me, supporting Pointshop & ULX GB.