• Couldn't include file 'includes\modules\mysqloo.lua' (File not found)
    5 replies, posted
[B]Hello world ![/B] I just installed MySQLOO module to work on mysql database on my own gamemode. I've made a config dir inside my gamemode where I put a database.lua [U]database.lua[/U] [CODE]require ("mysqloo") local DATABASE_HOST = "localhost" local DATABASE_PORT = 3306 local DATABASE_NAME = "databasename" local DATABASE_USERNAME = "root" local DATABASE_PASSWORD = "" function connectToDatabase() databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT) databaseObject.onConnected = function() print("Base de données connectée !") end databaseObject.onConnectionFailed = function() print("Echec de la connexion à la base de données.") end databaseObject:connect() end connectToDatabase()[/CODE] But when I load my gamemode as localserver, I get this [U]error[/U][CODE] [Hippomino|30|STEAM_0:0:17900658] Lua Error: Couldn't include file 'includes\modules\mysqloo.lua' (File not found) (@gamemodes/4realrp/gamemode/config/database.lua (line 1)) [Hippomino|30|STEAM_0:0:17900658] Lua Error: [ERROR] gamemodes/4realrp/gamemode/config/database.lua:1: Module not found! 1. require - [C]:-1 2. unknown - gamemodes/4realrp/gamemode/config/database.lua:1 3. include - [C]:-1 4. unknown - gamemodes/4realrp/gamemode/cl_init.lua:1 [Hippomino|30|STEAM_0:0:17900658] Lua Error: Couldn't include file 'includes\modules\mysqloo.lua' (File not found) (@gamemodes/4realrp/gamemode/config/database.lua (line 1)) [Hippomino|30|STEAM_0:0:17900658] Lua Error: [ERROR] gamemodes/4realrp/gamemode/config/database.lua:1: Module not found! 1. require - [C]:-1 2. unknown - gamemodes/4realrp/gamemode/config/database.lua:1 3. include - [C]:-1 4. unknown - gamemodes/4realrp/gamemode/cl_init.lua:4[/CODE] I'm sorry for my english, I hope you will understand and thank you for your help :smile: .
What's the name of the module file you put in?
[QUOTE=code_gs;50922763]What's the name of the module file you put in?[/QUOTE] I've followed the whole tutorial for installing MySQLOO v9 on Windows so I just put [B]libmysql.dll[/B] in the same directory that srcds.exe and the module [B]gmsv_mysqloo_win32.dll[/B] in /garrysmod/lua/bin/. There is no mysqloo.lua.
I just tried it on my local system and it worked. Are you sure that you are requiring it serverside only?
Ohayo, senpai! This is the programming subforum for [I]non Garry's Mod Lua related programming.[/I] The forum you're looking for is [url=https://facepunch.com/forumdisplay.php?f=65]over here![/url] Arigato, oni-chan [editline]21st August 2016[/editline] Ps: please be sure to read the sticky when you get there or you'll probably get banned and then you won't get any help. good luck!
[QUOTE=proboardslol;50924415]Ohayo, senpai! This is the programming subforum for [I]non Garry's Mod Lua related programming.[/I] The forum you're looking for is [url=https://facepunch.com/forumdisplay.php?f=65]over here![/url] Arigato, oni-chan [editline]21st August 2016[/editline] Ps: please be sure to read the sticky when you get there or you'll probably get banned and then you won't get any help. good luck![/QUOTE] Sorry for misunderstanding, proboardslol and thank you for adverting me. [editline]21st August 2016[/editline] I've solved my problem. In fact, if you include a file who require mysqloo inside a clientside file, it automatically makes this error. Thank you all for your help !
Sorry, you need to Log In to post a reply to this thread.