Need help with MYSQL

Post Reply
Rone
A regular
A regular
Posts: 40
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Oct 10, 2014 12:28 pm

Need help with MYSQL

Post by Rone »

I've never really understood databases so I've just tried as hard as I could to avoid them until now...

I recently got ez inv for my darkrp server and it seems to be having issues saving user's inventories. It has MySQL support, but I'm not sure how to make the MySQL database or hook it up to gmod.

I noticed on my server's autoinstallers you can get MySQLOO. What is that? Something that let's you connect to external databases? Anyways here's the config. Could anyone explain how to get this working?

Code: Select all

EZI.sql = {
	mysql 		= true, 		// Are you using MySQL on your server? if so enable this.
	ip			= "127.0.0.1", 	// IP of your MySQL server, it is recommended to have it hosted on your game server.
	username	= "username",	// Username of the MySQL account you wish to use.
	password	= "password",	// Password of the MySQL account you wish to use. !Keep this Secure!
	invtable	= "invtable",	// Table you're using on your MySQL server
	port		= 3306			// Port of your MySQL server, default is 3306.
}
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Need help with MYSQL

Post by soja »

mysqloo does enable the ability for your gmod server to use a database. It is usually required to connect to a database.

Do you have web hosting here, or somewhere else that you can use to create a database for the server?
Not a NFO employee
Rone
A regular
A regular
Posts: 40
Joined: Fri Oct 10, 2014 12:28 pm

Re: Need help with MYSQL

Post by Rone »

soja wrote:mysqloo does enable the ability for your gmod server to use a database. It is usually required to connect to a database.

Do you have web hosting here, or somewhere else that you can use to create a database for the server?
Yes, I have the basic plan. Gameserver + Webhosting
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Need help with MYSQL

Post by soja »

You can use the database tab in your web hosting to create a new database. After you do that, enable external connections(also on the database tab).

You can use the information on the database tab to fill in the config you posted.


Before you go further, it seems to have an option to use mysql, are you sure mysql is required? If you disable this it might use the sv.db for your server, which is sqlite and requires little to no setup.
Not a NFO employee
Rone
A regular
A regular
Posts: 40
Joined: Fri Oct 10, 2014 12:28 pm

Re: Need help with MYSQL

Post by Rone »

soja wrote:You can use the database tab in your web hosting to create a new database. After you do that, enable external connections(also on the database tab).

You can use the information on the database tab to fill in the config you posted.


Before you go further, it seems to have an option to use mysql, are you sure mysql is required? If you disable this it might use the sv.db for your server, which is sqlite and requires little to no setup.
As I said before, I can't use the default data system in gmod as it isn't working properly for my inventory mod.

So say the information given to me is this in the databases tab.

Code: Select all

Username: dummygmod
Password: dummypassword
Hostname: localhost (for external connections, use dummy.site.nfoservers.com)
Port: not needed for localhost connections; 3306 for external connections

Database Name: dummy_invtable
Would the config be this?

Code: Select all

EZI.sql = {
	mysql 		= true, 		// Are you using MySQL on your server? if so enable this.
	ip			= "dummy.site.nfoservers.com", 	// IP of your MySQL server, it is recommended to have it hosted on your game server.
	username	= "dummy",	// Username of the MySQL account you wish to use.
	password	= "dummypassword",	// Password of the MySQL account you wish to use. !Keep this Secure!
	invtable	= "dummy_invtable",	// Table you're using on your MySQL server
	port		= 3306			// Port of your MySQL server, default is 3306.
}
Sorry about being an idiot with databases
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Need help with MYSQL

Post by soja »

That looks right. I'm not sure if the config is worded poorly, or if it uses some sort of database automatically, but a tab is something contained INSIDE a database. Is there any place to specify which database to use?

Also, did the addon come with any files with the .sql extension?
Not a NFO employee
User avatar
TacTicToe
This is my homepage
This is my homepage
Posts: 848
Joined: Fri Feb 18, 2011 1:08 pm
Location: USA
Contact:

Re: Need help with MYSQL

Post by TacTicToe »

Everything looks good. I'm thinking he may just need to import the database tables to get things set up.
Post Reply