Jump to content

MySql problem


Sil3nT

Recommended Posts

Posted

Hello.

I have script where i need mysql and database. Thas okay. But when i start script then in console outputs this

ERROR: mgm\server.lua:9 dbConnect failed; Can't connect to MySql server on 'localhost' (10061)

This is that lua file

server = {} 
server.__index = server 
  
server.connection = dbConnect( "mysql", "dbname=elitedeh_my;host=localhost", "root", "" ) 
if ( server.connection ) then 
    outputDebugString("Connection to database successful") 
else 
    outputDebugString("Connection to database failed") 
end 

And yeah i tried 000webhost mysql and again that problem.

I just think i have writed wrong lua

Posted

000webhost is fine, just change 'localhost' to it's IP address. 'localhost' means you are running MySQL on the same computer, but you are obviously not.

Posted
000webhost is fine, just change 'localhost' to it's IP address. 'localhost' means you are running MySQL on the same computer, but you are obviously not.

so i need to change localhost to servers ip adress?

Posted (edited)
localhost its mean mysql server same host mta server and you can't use mysql server 000webhost

Seriously -.-" MySQL is online Databse you can connect to it remotely like i have an hosted domain who have give me 4 MySQL and i connect then to my Server. My Server and Web Host server aren't the same Company

SQL is LocalHost and not MySQL

Also yes 000webHost not accept Remote Connections

Edited by Guest
  • Moderators
Posted
SQL is LocalHost not MySQL

Not sure if you didn't explained correctly due to your english skill or if you are really doing a comparison between both of them.

Posted
SQL is LocalHost not MySQL

Not sure if you didn't explained correctly due to your english skill or if you are really doing a comparison between both of them.

Sorry for That and for my bad English Skills read it again i modify it

  • Moderators
Posted
Sorry for That and for my bad English Skills read it again i modify it

Well, it's still there:

SQL is LocalHost and not MySQL

What do you mean by that ?

Posted
Sorry for That and for my bad English Skills read it again i modify it

Well, it's still there:

SQL is LocalHost and not MySQL

What do you mean by that ?

localhost its mean mysql server same host mta server

i explain that local host isn't mean MySql server to be same with Mta server Host That MySQL can be and on other Host That only SQL need to be in Same Host of Mta Server as it's a file

Posted
Sorry for That and for my bad English Skills read it again i modify it

Well, it's still there:

SQL is LocalHost and not MySQL

What do you mean by that ?

localhost its mean mysql server same host mta server

i explain that local host isn't mean MySql server to be same with Mta server Host That MySQL can be and on other Host That only SQL need to be in Same Host of Mta Server as it's a file

No, you are wrong and he is right. Localhost means you are hosting it locally, so it is running on the same machine. You can of course change localhost with the other machines IP, but if you leave it as localhost or 127.0.0.1, then it should be running on the same machine.

  • Moderators
Posted
Sorry for That and for my bad English Skills read it again i modify it

Well, it's still there:

SQL is LocalHost and not MySQL

What do you mean by that ?

localhost its mean mysql server same host mta server

i explain that local host isn't mean MySql server to be same with Mta server Host That MySQL can be and on other Host That only SQL need to be in Same Host of Mta Server as it's a file

SQL is just a language that SQL based applications can understand. There is a lot of SQL servers mike MySQL, postgre and others.

You probably meant SQLite witch let you do the same things but the database is stored as a .db file.

SELECT * FROM users; 

is a SQL query and can be executed on MySQL or SQLite.

Hope it's more clear.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...