You are not logged in.

#1 2009-01-22 15:04:50

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

mysql user problems [solved]

hey, i have a problem with my mysql, when i try to login from shell, every account works, but when i try to login via php, it just says

Could not connect: Access denied for user 'root'@'localhost' (using password: NO)

but i dont even try to login with root, i tried multiple accounts and this is what i get all time...

Last edited by nst (2009-01-22 18:01:55)

Offline

#2 2009-01-22 15:08:51

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mysql user problems [solved]

It might help if you posted _how_ you are trying to connect. As in, post the script, so we can spot what's wrong...
Be sure to mangle your loginname/password though wink


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#3 2009-01-22 15:14:17

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

its just simple php script, as i said, same error i get when i try to use phpmyadmin, which i configured properly...

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // the username/password is correct
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

even why i change localhost to 127.0.0.1, its aint working sad

Offline

#4 2009-01-22 15:17:05

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mysql user problems [solved]

Is the mysql daemon listening on the default port?
Is it started?


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#5 2009-01-22 15:18:23

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

yep, its running on 3306, which is default port...

Offline

#6 2009-01-22 15:23:41

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mysql user problems [solved]

Just for the heck of it... Have you tried adding the portnumber to 'localhost' in mysql_connect ( 'localhost:3306' )?


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#7 2009-01-22 15:24:52

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

yeah, i tried, nothing works sad

Offline

#8 2009-01-22 15:28:29

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mysql user problems [solved]

Did you enable the mysql module in /etc/php/php.ini and restart the webserver?


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#9 2009-01-22 15:36:23

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

yeah, i have
extension=mysql.so uncommented

mysqlMySQL Support    enabled
Active Persistent Links     0 
Active Links     0 
Client API version     5.0.75 
MYSQL_MODULE_TYPE     external 
MYSQL_SOCKET     /tmp/mysql.sock 
MYSQL_INCLUDE     -I/usr/include/mysql 
MYSQL_LIBS     -L/usr/lib -lmysqlclient 

Directive    Local Value    Master Value
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    no value    no value
mysql.default_user    no value    no value
mysql.max_links    Unlimited    Unlimited
mysql.max_persistent    Unlimited    Unlimited
mysql.trace_mode    Off    Off

this is from phpinfo, as you can see, the module works properly afaik.

now i got rid of it, but i keep getting another error:

Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

smile its kinda funny now, after the 24 hours im installing and configuring this server smile)

Offline

#10 2009-01-22 15:59:25

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

Alright, im completely lost, no idea what to do with it, i tried increasing timeouts, but no success hmm

Offline

#11 2009-01-22 18:01:42

nst
Member
From: Czech Republic
Registered: 2007-04-02
Posts: 25

Re: mysql user problems [solved]

alright, solved, i just removed and installed again mysql and used it with same configs, and it works smile

Offline

#12 2009-01-22 18:47:55

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: mysql user problems [solved]

good job wink


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

Board footer

Powered by FluxBB