You are not logged in.
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
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
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
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
Offline
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
yep, its running on 3306, which is default port...
Offline
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
yeah, i tried, nothing works
Offline
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
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
its kinda funny now, after the 24 hours im installing and configuring this server )
Offline
Alright, im completely lost, no idea what to do with it, i tried increasing timeouts, but no success
Offline
alright, solved, i just removed and installed again mysql and used it with same configs, and it works
Offline
good job
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