dbTalk Databases Forums  

mysql - can't connect through apache

comp.databases.mysql comp.databases.mysql


Discuss mysql - can't connect through apache in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cerr
 
Posts: n/a

Default mysql - can't connect through apache - 01-17-2012 , 11:56 AM






Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron

Reply With Quote
  #2  
Old   
Luuk
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-17-2012 , 02:09 PM






On 17-01-2012 18:56, cerr wrote:
Quote:
Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron
What is the output of:
netstat -antp | grep 3306

It should show something like:
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN -

which means MySQL is listening on port 3306 to receive requests.

After that, write a PHP-page (i.e. phpinfo.php)like this:
<?php
phpinfo();
?>

It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL

for an example of the output you should get:
http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)

--
Luuk

Reply With Quote
  #3  
Old   
cerr
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-17-2012 , 02:24 PM



On Jan 17, 12:09*pm, Luuk <L... (AT) invalid (DOT) lan> wrote:
Quote:
On 17-01-2012 18:56, cerr wrote:

Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron

What is the output of:
netstat -antp | grep 3306

It should show something like:
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0..0.0:*
LISTEN * * *-
Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN 13136/mysqld

Quote:
which means MySQL is listening on port 3306 to receive requests.

After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
* phpinfo();
?

It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL

for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)
My output looks a little different:
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive Local Value Master Value
mysql.allow_local_infile On On
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket /opt/lampp/var/mysql/mysql.sock /opt/lampp/var/
mysql/mysql.sock
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

Reply With Quote
  #4  
Old   
cerr
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 01:27 PM



On Jan 17, 12:24*pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
Quote:
On Jan 17, 12:09*pm, Luuk <L... (AT) invalid (DOT) lan> wrote:









On 17-01-2012 18:56, cerr wrote:

Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron

What is the output of:
netstat -antp | grep 3306

It should show something like:
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0..0.0.0:*
LISTEN * * *-

Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0..0.0:*
LISTEN * * *13136/mysqld



which means MySQL is listening on port 3306 to receive requests.

After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
* phpinfo();
?

It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL

for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)

My output looks a little different:
MySQL Support * *enabled
Active Persistent Links *0
Active Links * * 0
Client API version * * * mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive * * * *Local Value * * Master Value
mysql.allow_local_infile * * * * On * * *On
mysql.allow_persistent * On * * *On
mysql.connect_timeout * *60 * * *60
mysql.default_host * * *no value * * * *no value
mysql.default_password *no value * * * *no value
mysql.default_port * * *no value * * * *no value
mysql.default_socket * * /opt/lampp/var/mysql/mysql.sock * * * * /opt/lampp/var/
mysql/mysql.sock
mysql.default_user * * *no value * * * *no value
mysql.max_links *Unlimited * * * Unlimited
mysql.max_persistent * * Unlimited * * * Unlimited
mysql.trace_mode * * * * Off * * Off
No one here that can help me?

Reply With Quote
  #5  
Old   
Luuk
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 02:10 PM



On 18-01-2012 20:27, cerr wrote:
Quote:
On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:









On 17-01-2012 18:56, cerr wrote:

Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron

What is the output of:
netstat -antp | grep 3306

It should show something like:
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN -

Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN 13136/mysqld



which means MySQL is listening on port 3306 to receive requests.

After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
phpinfo();
?

It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL

for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)

My output looks a little different:
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive Local Value Master Value
mysql.allow_local_infile On On
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket /opt/lampp/var/mysql/mysql.sock /opt/lampp/var/
mysql/mysql.sock
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

No one here that can help me?
sorry, i'm out of options

only one i can think of is checking logfiles, but i bet you've done that
already

or, if logfiles are 'empty', try enabling them...

--
Luuk

Reply With Quote
  #6  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 02:42 PM



cerr wrote:
Quote:
On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:









On 17-01-2012 18:56, cerr wrote:
Hi,
I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.
Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!
Thanks alot!
Ron
What is the output of:
netstat -antp | grep 3306
It should show something like:
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN -
Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN 13136/mysqld



which means MySQL is listening on port 3306 to receive requests.
After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
phpinfo();
?
It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL
for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)
My output looks a little different:
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive Local Value Master Value
mysql.allow_local_infile On On
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket /opt/lampp/var/mysql/mysql.sock /opt/lampp/var/
mysql/mysql.sock
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

No one here that can help me?

I would GUESS that your default installation wont connecte except by
either the unix socket /opt/lampp/var/mysql/mysql.sock

or on the loopback interface 127.0.0.1

I found when setting up my own system that the c library API didnt like
'localhost' but was happy with '127.0.0.1'

I'll see what my.conf says ...

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently
parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# 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


Now that will accept connections on both the .sock unix socket and
127.0.0.1:3306

It may be that one or other of the programs is expecting that to be
active, and it isn't

edit the file /etc/mysql/my.cnf and restart mysqld..

Reply With Quote
  #7  
Old   
Luuk
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 03:07 PM



On 18-01-2012 21:42, The Natural Philosopher wrote:
Quote:
cerr wrote:
On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:









On 17-01-2012 18:56, cerr wrote:
Hi,
I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.
Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!
Thanks alot!
Ron
What is the output of:
netstat -antp | grep 3306
It should show something like:
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN -
Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:*
LISTEN 13136/mysqld



I would GUESS that your default installation wont connecte except by
either the unix socket /opt/lampp/var/mysql/mysql.sock

or on the loopback interface 127.0.0.1

I found when setting up my own system that the c library API didnt like
'localhost' but was happy with '127.0.0.1'


because 'netstat -ant.....' said:
0.0.0.0:3306

mysql MUST be listening to more that just 'localhost', or '127.0.0.1'

If it's just listenting to 'localhost' it would have said:
127.0.0.1:3306


--
Luuk

Reply With Quote
  #8  
Old   
cerr
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 03:26 PM



On Jan 18, 12:10*pm, Luuk <L... (AT) invalid (DOT) lan> wrote:
Quote:
On 18-01-2012 20:27, cerr wrote:









On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:

On 17-01-2012 18:56, cerr wrote:

Hi,

I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.

Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla..
Any hints?
Heklp would be appreciated!

Thanks alot!

Ron

What is the output of:
netstat -antp | grep 3306

It should show something like:
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *-

Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *13136/mysqld

which means MySQL is listening on port 3306 to receive requests.

After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
* phpinfo();
?

It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL

for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)

My output looks a little different:
MySQL Support * *enabled
Active Persistent Links *0
Active Links * * 0
Client API version * * * mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive * * * *Local Value * * Master Value
mysql.allow_local_infile * * * * On * * *On
mysql.allow_persistent * On * * *On
mysql.connect_timeout * *60 * * *60
mysql.default_host * * *no value * * * *no value
mysql.default_password *no value * * * *no value
mysql.default_port * * *no value * * * *no value
mysql.default_socket * * /opt/lampp/var/mysql/mysql.sock * * * * /opt/lampp/var/
mysql/mysql.sock
mysql.default_user * * *no value * * * *no value
mysql.max_links *Unlimited * * * Unlimited
mysql.max_persistent * * Unlimited * * * Unlimited
mysql.trace_mode * * * * Off * * Off

No one here that can help me?

sorry, i'm out of options

only one i can think of is checking logfiles, but i bet you've done that
already

or, if logfiles are 'empty', try enabling them...
in /var/log/mysql/error.log it doesn't say anything when I attempt to
connect e.g.
there's just some standard messages visible:
reg@reg-desktop:/var/log/mysql$ tail -f error.log
120117 10:26:10 InnoDB: Shutdown completed; log sequence number 0
43655
120117 10:26:10 [Note] /usr/sbin/mysqld: Shutdown complete

120117 10:26:11 [Note] Plugin 'FEDERATED' is disabled.
120117 10:26:11 InnoDB: Initializing buffer pool, size = 8.0M
120117 10:26:11 InnoDB: Completed initialization of buffer pool
120117 10:26:12 InnoDB: Started; log sequence number 0 43655
120117 10:26:12 [Note] Event Scheduler: Loaded 0 events
120117 10:26:12 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.58-1ubuntu1' socket: '/var/run/mysqld/mysqld.sock'
port: 3306 (Ubuntu)

Reply With Quote
  #9  
Old   
cerr
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 03:34 PM



On Jan 18, 12:42*pm, The Natural Philosopher <t... (AT) invalid (DOT) invalid>
wrote:
Quote:
cerr wrote:
On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:

On 17-01-2012 18:56, cerr wrote:
Hi,
I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g.
Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla..
Any hints?
Heklp would be appreciated!
Thanks alot!
Ron
What is the output of:
netstat -antp | grep 3306
It should show something like:
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *-
Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *13136/mysqld

which means MySQL is listening on port 3306 to receive requests.
After that, write a PHP-page (i.e. phpinfo.php)like this:
?php
* phpinfo();
?
It should give you all kinds of info about your system.
There is some info about how ( and if) PHP can contact MySQL
for an example of the output you should get:http://example.com.customers.tigertech.net/phpinfo.php
(scroll down to see the 'mysql' info....)
My output looks a little different:
MySQL Support * *enabled
Active Persistent Links *0
Active Links * * 0
Client API version * * * mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive * * * *Local Value * * Master Value
mysql.allow_local_infile * * * * On * * *On
mysql.allow_persistent * On * * *On
mysql.connect_timeout * *60 * * *60
mysql.default_host * * *no value * * * *no value
mysql.default_password *no value * * * *no value
mysql.default_port * * *no value * * * *no value
mysql.default_socket * * /opt/lampp/var/mysql/mysql.sock * * * * /opt/lampp/var/
mysql/mysql.sock
mysql.default_user * * *no value * * * *no value
mysql.max_links *Unlimited * * * Unlimited
mysql.max_persistent * * Unlimited * * * Unlimited
mysql.trace_mode * * * * Off * * Off

No one here that can help me?

I would GUESS that your default installation wont connecte except by
either the unix socket /opt/lampp/var/mysql/mysql.sock

or on the loopback interface 127.0.0.1

I found when setting up my own system that the c library API didnt like
'localhost' but was happy with '127.0.0.1'

I'll see what my.conf says ...

[client]
port * * * * * *= 3306
socket * * * * *= /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently
parsed.
[mysqld_safe]
socket * * * * *= /var/run/mysqld/mysqld.sock
nice * * * * * *= 0

[mysqld]
#
# * Basic Settings
#
user * * * * * *= mysql
pid-file * * * *= /var/run/mysqld/mysqld.pid
socket * * * * *= /var/run/mysqld/mysqld.sock
port * * * * * *= 3306
basedir * * * * = /usr
datadir * * * * = /var/lib/mysql
tmpdir * * * * *= /tmp
language * * * *= /usr/share/mysql/english
skip-external-locking
#
# 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
Yep, I have tried with 127.0.0.1 and localhost and then read that when
it's commented out, it'll just take your current IP. And taht's what I
ended up doing, but just to try again, I set it back to 127.0.0.1 now,
triggered a "/etc/init.d/mysql restart" but still no change...
Quote:
Now that will accept connections on both the .sock unix socket and
127.0.0.1:3306

It may be that one or other of the programs is expecting that to be
active, and it isn't

edit the file /etc/mysql/my.cnf and restart mysqld..
That's a bummer! I can't believe it!!!! Why is this? How what else
could be messed up, maybe my MySQLi installation...? How could I get
this fixed...?

Reply With Quote
  #10  
Old   
cerr
 
Posts: n/a

Default Re: mysql - can't connect through apache - 01-18-2012 , 03:36 PM



On Jan 18, 1:07*pm, Luuk <L... (AT) invalid (DOT) lan> wrote:
Quote:
On 18-01-2012 21:42, The Natural Philosopher wrote:









cerr wrote:
On Jan 17, 12:24 pm, cerr <ron.egg... (AT) gmail (DOT) com> wrote:
On Jan 17, 12:09 pm, Luuk <L... (AT) invalid (DOT) lan> wrote:

On 17-01-2012 18:56, cerr wrote:
Hi,
I have a LAMP installation. I can properly access my db from the shell
but am not able to get in via apache, with phpmyadmin or Joomla e.g..
Any clues?
I'm pretty muich stuck, I tried configuring stuff around,
root@localhost with password works just fine on the shell.... but i'm
notable to use that user to login with either, phpmyadmin nor joomla.
Any hints?
Heklp would be appreciated!
Thanks alot!
Ron
What is the output of:
netstat -antp | grep 3306
It should show something like:
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *-
Yep, I got

root@reg-desktop:~# netstat -antp | grep 3306
tcp * * * *0 * * *0 0.0.0.0:3306 * * * * * *0.0.0.0:*
LISTEN * * *13136/mysqld

I would GUESS that your default installation wont connecte except by
either the unix socket /opt/lampp/var/mysql/mysql.sock

or on the loopback interface 127.0.0.1

I found when setting up my own system that the c library API didnt like
'localhost' but was happy with '127.0.0.1'

because 'netstat -ant.....' said:
0.0.0.0:3306

mysql MUST be listening to more that just 'localhost', or '127.0.0.1'

If it's just listenting to 'localhost' it would have said:
127.0.0.1:3306

Now:
root@reg-desktop:/var/log/mysql# netstat -ant | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:*
LISTEN

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.