Author Topic: connecting to port 3307 question  (Read 2597 times)

0 Members and 1 Guest are viewing this topic.

Offline bassetTopic starter

  • Irregular
  • Posts: 7
  • Gender: Male
    • View Profile
    • JG53 "PikAs"
connecting to port 3307 question
« on: February 27, 2010, 04:29:10 PM »
Hello,

I am have 2 identical programs - 1 mysql database is running on port 3306, this is working no problem.

When I install a 2nd mysql database on port 3307, I cant connect to it and get the error posted below.


Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost:3307' (11004) in C:\Users\admin\Desktop\xampp\htdocs\statsmds\includes\header.inc on line 23
Connect failed: Unknown MySQL server host 'localhost:3307' (11004)

This is in the code to connect to the database:
// mysql host
$sql_host   = "localhost:3307";

How do I connect to port 3307, everything is on the local computer.

Im sure the fix is easy - Im a newb at this stuff.

Thanks, for looking!
« Last Edit: February 27, 2010, 04:37:26 PM by basset »

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: connecting to port 3307 question
« Reply #1 on: February 27, 2010, 11:55:39 PM »
Why would you need two instances of a mysql server on the same machine?

Offline bassetTopic starter

  • Irregular
  • Posts: 7
  • Gender: Male
    • View Profile
    • JG53 "PikAs"
Re: connecting to port 3307 question
« Reply #2 on: February 28, 2010, 01:56:47 AM »
"Note:  If you are going to run multiple IL2 servers edit the above scripts and change the schema name for each server.  Each Server should have its own schema."

This was from the install instructions - I tried to install into the seprate schema, but had no luck. For better or worse I just loaded another mysql on port 3307 to get  the data base loaded.

If there is a way to to get the scripts to run on the 3306 mysql server, I would be grateful for the help.

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,255
    • View Profile
Re: connecting to port 3307 question
« Reply #3 on: February 28, 2010, 02:01:00 AM »
Quote
I tried to install into the seprate schema, but had no luck.

Maybe you should give us some details about this.

Offline bassetTopic starter

  • Irregular
  • Posts: 7
  • Gender: Male
    • View Profile
    • JG53 "PikAs"
Re: connecting to port 3307 question
« Reply #4 on: February 28, 2010, 09:26:16 AM »
IIll go through step by step the install process I am going through on the 3306 machine until I get to the error inloading the database.

I log into the mysql database useing MySql query browser under root, and the mysql schema and run 'fbdjstats database setup.sql’

Orginal script:
CREATE USER fbdadmin IDENTIFIED BY 'fbdadmin';
CREATE USER fbduser IDENTIFIED BY 'fbduser';
GRANT USAGE ON *.* TO fbdadmin;
CREATE DATABASE IF NOT EXISTS fbdjstats character set utf8 collate utf8_bin;

I make a few changes:
CREATE USER mdsfbdadmin IDENTIFIED BY 'mdsfbdadmin';
CREATE USER mdsfbduser IDENTIFIED BY 'mdsfbduser';
GRANT USAGE ON *.* TO mdsfbdadmin;
CREATE DATABASE IF NOT EXISTS mdsfbdjstats character set utf8 collate utf8_bin;

Thus excutes fine - database is created abd users are created.

exit

Offline bassetTopic starter

  • Irregular
  • Posts: 7
  • Gender: Male
    • View Profile
    • JG53 "PikAs"
Re: connecting to port 3307 question
« Reply #5 on: February 28, 2010, 09:31:30 AM »
I open MySql Administrator using root and add the proper privileges to mdsfbdadmin (add everything)  and mdsfbduser (only add select and excute) . for the schema mdsfbdjstats.

exit

Offline bassetTopic starter

  • Irregular
  • Posts: 7
  • Gender: Male
    • View Profile
    • JG53 "PikAs"
Re: connecting to port 3307 question
« Reply #6 on: February 28, 2010, 09:57:10 AM »
here is the step where I run into a issue:

I connect to the database using MySQL Query Browser with the mdsfbdadmin account and the mdsfbdjstats schema.

instrustions say to run 2 scripts:

Wait -


I dont believe this - IT WORKS!!

LOL - why this time and not all day yesterday??  I have no idea - but I guess going through this step by step and posting in the forums as I go did it!!

I worked on this yesterday for 12 hours before just createing a new database is desperation.

THANK YOU THORPE for offering your time and knowledge.  Your greatly apprciated!!