Access denied when connecting to database
Brought to you by:
stedo
I finally got the server and client side running. Now
when I try to log into the client I immediately get access
denied to the server error. I get the same thing when
trying to connect to phadmin. Don't know much about
mysql so it could be I've set the users up wrong but root
can't even connect. Help please.
Logged In: YES
user_id=984082
hi,
Have you had the client and server working before? Remember
when you move to a remote connection the URL for the
database must contain the correct host. It cannot be set to
localhost as clients will not find it.
If you still have problems, post me you cfg files and I can
take a look at them.
Thanks
Steve
Logged In: YES
user_id=1195187
Hi Steve,
Thanks for the response. This is a fresh install and I've never
had it working. Here is my server config:
#Paper Harbour Configuration File saved by Administrator.
#Fri May 28 15:43:20 CEST 2004
#Server Port
SERVER_PORT=4040
#Time out between each socket accept
SERVER_TIMEOUT=10
#Server Database password
SERVER_PASSWORD=********
#Server Database user name
SERVER_USER=root
#CLient Database password
CLIENT_PASSWORD=test
#Client Database user name
CLIENT_USER=client
#The address of your email server
MAIL_SERVER= mail.pcnm.com
#The port of your email server (default 25)
MAIL_PORT=25
#The email address of your administrator
ROOT_MAIL=rwyles@pcnm.com
#Archive directory, important to include the last /
ARCHIVE_ROOT=C:/PAPER HARBOUR ARCHIVE/
#Database URL, important that autoReconnect is set
DATABASE=jdbc:mysql://192.168.30.176/:3306/dms?
autoreconnect=true
#Database Driver
DATABASE_DRIVER=com.mysql.jdbc.Driver
#DEBUGGING (FOR DEVELOPMENT ONLY)
DEBUGGER=OFF
Here is my client config:
#Paper Harbour client configuration file.
#Driver for the database
DATABASE_DRIVER=com.mysql.jdbc.Driver
#The name of the server machine or IP number
SERVER_HOST=192.168.30.176
#The port the server is listening on, default 4040
SERVER_PORT=4040
#DEBUGGING (FOR DEVELOPMENT ONLY)
DEBUGGER=OFF
I appreciate the help.
Rusty
Logged In: YES
user_id=984082
hi,
I think there could be a problem with your database url in
the server configuration, it reads:
DATABASE=jdbc:mysql://192.168.30.176/:3306/dms?
autoreconnect=true
Try changing it to:
DATABASE=jdbc:mysql://192.168.30.176:3306/dms?
autoreconnect=true
You can also set DEBUGGER=909498 so you can see what is
happening.
Let me know if it works.
Thanks
Steve
Logged In: NO
That DEBUGGER=909498 is awesome. Still getting access
denied errors so here is the DEBUGGER log:
C:\Documents and Settings\Administrator\Desktop>java -cp
C:\PaperHarbour\release
\libs\mysql-connector-java-3.1.6-
bin.jar;C:\PaperHarbour\release\PaperHarbour.ja
r st.run.PhServer C:\PaperHarbour\release
Starting Server....
Reading configuration...
Port: 4040
Timeout: 10000
Archive: C:/PAPER HARBOUR ARCHIVE/
Mail Port: 25
Mail Server: mail.pcnm.com
Root Mail: rwyles@pcnm.com
DB url:jdbc:mysql://192.168.30.176:3306/dms?
autoreconnect=true
Driver: com.mysql.jdbc.Driver
...server running.
Accepting connections...
Accepting connections...
CONNECTION: 0.0.0.0
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 24
Read: +47O69Kir0kvAYAjkkhs9g==
RCVD FROM pcnmlt2.pcnm2.com: req_connect
STATE pcnmlt2.pcnm2.com : WAITING
COMMAND TO pcnmlt2.pcnm2.com: connect_ok
Wrote: [PHPDATA]
Wrote: [24]
Wrote: eCk1Y9APfj9VCTJp+9A7uQ==
SENT TO pcnmlt2.pcnm2.com: connect_ok
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 32
Read: hL6/gA/NGRTYjpcSFyTwMaKXXmZL7pIR
RCVD FROM pcnmlt2.pcnm2.com: req_access client test
STATE pcnmlt2.pcnm2.com : ACCESS_CONTROL
SQL:SELECT * FROM SECTABLE WHERE SECTABLE_A = 'client'
AND SECTABLE_B = PASSWORD
('test');
COMMAND TO pcnmlt2.pcnm2.com: access_denied
Wrote: [PHPDATA]
Wrote: [24]
Wrote: iVCyew5GTdsFKwuwKRld3g==
SENT TO pcnmlt2.pcnm2.com: access_denied
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 24
Read: 7Y9vHD/kY+Hhu97cwguBxw==
RCVD FROM pcnmlt2.pcnm2.com: cli_disconnect
STATE pcnmlt2.pcnm2.com : WAITING
COMMAND TO pcnmlt2.pcnm2.com: serv_disconnect
Wrote: [PHPDATA]
Wrote: [24]
Wrote: DCkRDH6FKHzvR6ROu5GE5g==
SENT TO pcnmlt2.pcnm2.com: serv_disconnect
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
Accepting connections...
CONNECTION: 0.0.0.0
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 24
Read: +47O69Kir0kvAYAjkkhs9g==
RCVD FROM pcnmlt2.pcnm2.com: req_connect
STATE pcnmlt2.pcnm2.com : WAITING
COMMAND TO pcnmlt2.pcnm2.com: connect_ok
Wrote: [PHPDATA]
Wrote: [24]
Wrote: eCk1Y9APfj9VCTJp+9A7uQ==
SENT TO pcnmlt2.pcnm2.com: connect_ok
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 32
Read: hL6/gA/NGRTX/l6+QIuie0XePTaL05dG
RCVD FROM pcnmlt2.pcnm2.com: req_access ADMIN admin
STATE pcnmlt2.pcnm2.com : ACCESS_CONTROL
SQL:SELECT * FROM SECTABLE WHERE SECTABLE_A
= 'ADMIN' AND SECTABLE_B = PASSWORD(
'admin');
COMMAND TO pcnmlt2.pcnm2.com: access_denied
Wrote: [PHPDATA]
Wrote: [24]
Wrote: iVCyew5GTdsFKwuwKRld3g==
SENT TO pcnmlt2.pcnm2.com: access_denied
Reading a packet...
Char - [
Reading a tag...
Read: [PHPDATA]
Read: 24
Read: 7Y9vHD/kY+Hhu97cwguBxw==
RCVD FROM pcnmlt2.pcnm2.com: cli_disconnect
STATE pcnmlt2.pcnm2.com : WAITING
COMMAND TO pcnmlt2.pcnm2.com: serv_disconnect
Wrote: [PHPDATA]
Wrote: [24]
Wrote: DCkRDH6FKHzvR6ROu5GE5g==
SENT TO pcnmlt2.pcnm2.com: serv_disconnect
Thanks again.
Rusty
Logged In: YES
user_id=984082
hi,
Okay, looks like you connect to the database okay. Did you
import the database structure to mysql when you installed
Paper Harbour? You use the correct password and username
(ADMIN:admin) so if the database is set up correctly it
should work. You import the Ph data by going to the database
directory where you installed Paper Harbour and type:
mysql -u root -p dms < PaperHarbour104.sql
This loads the database image.
Thanks
Steve
Logged In: YES
user_id=1195187
I did import the database and have all the tables. Weird. I
guess I'll try reinstalling everything and see if that helps.
Thanks for your support and I'll let you know the outcome.
Logged In: YES
user_id=1195187
Hi Steve,
A re-install did no good. I do have some questions though
after staring at this for a few hours and testing. All the
tables are set up correctly.
1. When I create new users, they don't show up in the
sectable table of the paperharbour database but they do
show up in the mysql database user table.
2. The sectable containes sectable_a with a value of ADMIN
and sectable_b with a value of 43e9a4ab75570f5b which I'm
assuming is the encrypted form of the password 'admin'.
Looking at the debug log, is it possible the encryption keys
are different since the stored procedure SELECT * FROM
SECTABLE WHERE SECTABLE_A = 'ADMIN' AND SECTABLE_B =
PASSWORD=('admin') isn't working? It should work. All the
data is there that it wants to select from yet I still get the
acess denied to server error. Help.
Rusty
Logged In: YES
user_id=1195187
Update:
I've been able to log into the admin module by creating a user
(any username) with the password of admin. This gets
created in the mysql database user table with the encrypted
password. I copied this password into the sectable_b field
replacing what was set up as default when I imported the
PaperHarbour104.sql. Now I can login to phadmin. However,
when I try phclient now I receive a new error that states "An
error occurred when attempting to load the database driver."
Is there an easy fix for this?
Logged In: YES
user_id=984082
hi,
Okay, it sounds like the class path for the client is wrong.
Are you running the client from the same directory as the
admin? Check the PAPER_HARBOUR environment variable to make
sure it is pointing to your install directory. Also check
you libs directory and may sure the database driver jar for
mysql is there.
Let me know if it works.
Best Regards
Stephen