You are not logged in.

#1 2011-05-28 22:23:18

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

[solved]mysql access denied - from local host and across local network

my app cant access the database, even from the localhost web browser


error message

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'xxxxuser'@'localhost' (using password: YES)

Fatal error: Access denied for user 'xxxxuser'@'localhost' (using password: YES)

connection string;

define("MYSQL_CONNECTION_STRING", "mysql://" . DB_USER1 . ":" . USER1_PASSWORD . "@" . DB_HOST . "/" . DB_SITE);

my conf files;

/opt/lampp/etc/my.cnf

[client]
#password    = your_password
port        = 3306
socket        = /opt/lampp/var/mysql/mysql.sock
[mysqld]
user        = nobody
port        = 3306
socket        = /opt/lampp/var/mysql/mysql.sock
skip-external-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-error=/opt/lampp/logs/mysql.log

#skip-networking


/etc/hosts.allow

mysqld: ALL : ALLOW
mysqld-max: ALL : ALLOW


phpmyadmin settings;

priveleges section
host %
password yes
global priveleges ALL PRIVELEGES
Grant Yes
database xxxxuser\_%

#ping 127.0.0.1:3306
no reply

#ping 127.0.0.1
yes replies

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN     
tcp        0      0 192.168.2.10:49136      74.125.224.103:80       ESTABLISHED
tcp        0      0 192.168.2.10:139        192.168.2.101:53410     ESTABLISHED

Last edited by wolfdogg (2011-06-03 21:23:33)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#2 2011-05-28 23:48:33

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [solved]mysql access denied - from local host and across local network

Have you created "xxxxuser" and executed a "flush privileges" command?

Offline

#3 2011-05-29 01:14:46

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [solved]mysql access denied - from local host and across local network

no, i created the user in phpmyadmin.  i didnt use the mysql admin tool.  i just went in there now and
# /etc/rc.d/mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql -u root mysql
mysql> UPDATE user SET password="NEW_PASSWORD" WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit

on teh FLUSH PRIVILEGES command i forgot the semicolon at the end, and kept tying stuff in, until i ctrl+c, i hope i didnt mess anything up there by doing this.

still no access to xxxxuser for the app

then i just removed the users that i added, when i went to add them back i noticed that looked odd, that i saw earlier, it might be a problem, there is 2 root users listed in the privileges, one is Host localhost, and one is under Host linux.  is this right?

Last edited by wolfdogg (2011-05-29 01:24:59)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#4 2011-05-29 01:19:11

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [solved]mysql access denied - from local host and across local network

so i flushed again, and 0 rows affected again

why is this missing in my php.ini completely?
extension=mysql.so

and when i set it, it cant find the module?

Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mysql.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

did it go missing with the installation possibly?

---------------------------------------------------------------

ok, i fixed it.  it looks like when i create a user using phpmyadmin and set the host for %, its not working for some reason that i have to figure out, because i dont like it when things that are supposed to work dont work.  so i set the user host to 'localhost' instead, and that fixed it.  well, atleast it fixed it when accessed from the localhost, but not sure if it will work from my other network pc's, sounds like it wont.  cant check right now. 

and still havent figured out how mysql.so is loading since its not inside my php.ini file.  i didnt see it in httpd.conf either.  im guessing there is another conf file loaded somewhere, such as php.ini.pacman or something?

either way, problem solved.  i will be monitoring this topic if anybody has any input on these two last issues.  thanks.

Last edited by wolfdogg (2011-05-29 04:12:49)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#5 2011-05-29 04:42:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [solved]mysql access denied - from local host and across local network

/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mysql.so

This isn't a standard path for anything to do with LAMP in Arch... I'm not sure what you've done there....

Offline

#6 2011-05-29 06:51:52

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [solved]mysql access denied - from local host and across local network

you know i was thinking the same thing, the only conclusion i came up with is its the version of apache that it installed, and it made its own directory for it to keep the code seperate incase another version is installed.

yeah, that looks normal, because the directory does exist, and thats a specific thread safe vs non thread safe version of apache i believe.


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#7 2011-06-03 21:22:31

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [solved]mysql access denied - from local host and across local network

i reinstalled because i was feeling too constricted with the xampp installation, went to an official LAMP install.  i dont have that permission problem that i did with the xampp install, so i dont have to worry about keeping the privileges for a specific user just to localhost anymore, can set it to % without a hitch.  so must have been some config with that install that was causing it. 

it was almost easier to set up lamp from scratch, and theres tons of benifits.


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

Board footer

Powered by FluxBB