Jump to content

Can't connect to mysql


Wei

Recommended Posts

Posted

I am using dbConnect function and since I bought VPS server I can't connect to mysql with this functions. I have tryed to connect with php mysql and is working fine with same information.

Did anyone had same problem with that ?

Posted

Yes apache is running on the same machine.

I've tested like this

<!DOCTYPE html> 
<html> 
<body> 
  
<h1>My first PHP page</h1> 
  
<?php 
echo "Hello World!"; 
// Create connection 
$con=mysqli_connect("localhost","root","","rgaming"); 
  
// Check connection 
if (mysqli_connect_errno()) 
  { 
  echo "Failed to connect to MySQL: " . mysqli_connect_error(); 
  } 
?> 
  
</body> 
</html> 
  

Yes mysql server is running localy

  • 1 month later...
  • 2 weeks later...
Posted

In fact there is 2 ways of using MySQL.

> MTA Built-in functions (dbConnect, dbQuery ...)

> MTA Team MySQL Module (mysql_connect, mysql_close, ...)

I understand it now and i'll use Built-in functions for the next scripts.

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...