Using SQL Maestro

tonymcv1

New Member
Messages
7
Reaction score
0
Points
0
I want to use SQL Maestro to work on my MySQL databases but I need the connection settings required to access X10hosting.
I found a thread that told me to use these settings:

  • Host = 'localhost'
  • Port = '3306'
  • User = [Your cPanel username followed by an underscore and the MySQL username you configured in cPanel]
  • Pass = [The password that you used when creating the MySQL user]
  • Database = [ Your cPanel username followed by an underscore and the name of the database that you created in cPanel]

However, when I try to connect, I get the message -
Can't connect to MySQL on localhost (10061)

Has anyone successfully connected using SQL Maestro? I'd appreciate some help.

Thanks.
 

prox12

Member
Messages
45
Reaction score
0
Points
6
PHP:
<html>
     <head></head>
<body>
.................

<?php
function write_in_db() {
$servername = 'localhost';
$username = 'cpanel_username';
$password 'password';
$database = "your_db_name";

$db_connection = mysql_connect($servername, $username, $password)
or die ("Unable to connect to the DB Server!");

mysql_select_db($database) or die ("Can't select database!");

 $query = 'INSERT INTO `contacts` '. 
'(
`firstname`,
`lastname`
) VALUES (
\'' . $_POST['firstname'] . '\', 
\'' . $_POST['lastname'] . '\'

);';

// execute query
$result = mysql_query($query) or die ("Error in query: $query. <br>".mysql_error());
return "inserted ".$_POST['firstname']." and his info into 'contacts'";
}
?>

...............

<?php if(isset($_POST['s_save'])) { echo write_in_db(); } ?>

<form ........ method="post"
some form fields

<input type="submit" name="s_save" value="save">

</form>

...........................

</body>
</html>
 

tonymcv1

New Member
Messages
7
Reaction score
0
Points
0
Thanks for that reply but it doesn't help. You cant write an SQL routine at all until you are connected to a database in SQL Maestro. What I need is the settings to enable me to connect to the server.
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
'localhost' means that the software is on the same computer as the mysql database. I believe you will be using yoursite.x10hosting.com:3306 or maybe yourserver.x10hosting.com (server being stoli, cossacks, etc)
 

tonymcv1

New Member
Messages
7
Reaction score
0
Points
0
Again, thanks for the reply.
I've tried what you suggested; no joy I'm afraid....
 

garrettroyce

Community Support
Community Support
Messages
5,611
Reaction score
249
Points
63
Top