Raised This Month: $51 Target: $400
 12% 

Problems to connect to Mysql Cloud Server database


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Santi.
Member
Join Date: Oct 2010
Location: Cordoba(Argentina)
Old 10-05-2018 , 23:46   Problems to connect to Mysql Cloud Server database
Reply With Quote #1

Hi, I'm having this problem when trying to connect to mysql database located in a cloud server.
"Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

I already tried to solve this by creating a symbolic link of mysql.sock in /tmp/ but it didn't work.

Any idea?
Santi. is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-06-2018 , 02:33   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #2

Why not use the servers IP Address?
__________________
Neuro Toxin is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-06-2018 , 09:38   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #3

Use "127.0.0.1" or the correct path to the socket file instead of "localhost" as the DB hostname.
__________________
asherkin is offline
Santi.
Member
Join Date: Oct 2010
Location: Cordoba(Argentina)
Old 10-06-2018 , 13:22   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #4

Quote:
Originally Posted by asherkin View Post
Use "127.0.0.1" or the correct path to the socket file instead of "localhost" as the DB hostname.
I'm not in the same computer. I have my server in a dedicated server and the db un a cloud server
Santi. is offline
Santi.
Member
Join Date: Oct 2010
Location: Cordoba(Argentina)
Old 10-06-2018 , 13:22   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
Why not use the servers IP Address?
I use it
Santi. is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-06-2018 , 13:54   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #6

The error message you have posted indicates that "localhost" has been set at the "host" in the databases config.
__________________
asherkin is offline
Santi.
Member
Join Date: Oct 2010
Location: Cordoba(Argentina)
Old 10-06-2018 , 13:58   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #7

Quote:
Originally Posted by asherkin View Post
The error message you have posted indicates that "localhost" has been set at the "host" in the databases config.
Code:
Handle kv = CreateKeyValues("");
	KvSetString(kv,"driver", "default"); // default is mysql
	KvSetString(kv,"host","ip of the cloud server"); // not localhost neither 127.0...
	KvSetString(kv,"port","mysqlport");
	KvSetString(kv,"database", "database");
	KvSetString(kv,"user", "user");
	KvSetString(kv,"pass", "password");
This is the config I use
Santi. is offline
Santi.
Member
Join Date: Oct 2010
Location: Cordoba(Argentina)
Old 10-06-2018 , 15:59   Re: Problems to connect to Mysql Cloud Server database
Reply With Quote #8

The connection is done, I can connect to the server by mysql workbench, and in the server I can do the first query but after the connection die
Santi. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode