Jump to content

Recommended Posts

Posted

Hi Everyone, I have just installed Ubuntu and setup Apache, PHP and MySQL using the Terminal, I cannot seem to get MySQL working at all nothing is recognising it, I cant find 'bind-address = 127.0.0.1' in the my.cnf file to change to the servers IP like websites are telling me :(

 

Any Ideas?

 

Thanks Alot!

Posted

Some output of the errors you're receiving would be helpful in fixing the problem.

 

Run /etc/init.d/mysql and post the results. Also post your mysql config file for us to look at.

 

I have this in my my.cnf file:

 

#

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

bind-address = 127.0.0.1

 

If you don't have this in your my.cnf file, you can just add it in and then try restarting mysql

 

If it's running, then you'll see that if you run netstat and grep for 3306, which is the default port for mysql:

 

root@ubuntu-monitoring:/etc/mysql# netstat -an | grep 3306

tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

 

You'll also be able to telnet to it and get some kind of response:

 

root@ubuntu-monitoring:/etc/mysql# telnet 127.0.0.1 3306

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

@

5.0.75-0ubuntu10.5!/+*/O~PR,*xD&1c!vT!Cn

 

I would suggest keeping it just bound to 127.0.0.1 if you're just going to query it from Apache if it's hosted on the same machine. No sense in having it listen on the public interface unless you want outsiders trying to connect to it.

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



×
×
  • Create New...