How to connect Sybase from client tool for password Encrypted db - sybase-ase

Our back end Sybase db password encryption is enabled and for this I am unable to connect the db using any client tool. here is the exception:
Error connecting to datasource "UAT"
SQL Error [1640] [S1000]: Adaptive Server requires encryption of the login password on the network.
SQL Error [4002] [S1000]: Login failed
SQL Error [4002] [S1000]: Login failed.
Adaptive Server requires encryption of the login password on the network.
From java/ property file I ma bale to connect using below properties
ENCRYPT_PASSWORD=true
JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Have you tried isql (the command line tool) to confirm if your connection details are correct?
The basic command would be:
isql -U username -S servername -X
This will help determine if it is something more fundamental that is causing the problem.

Related

Problems connecting to Interbase on remote server using php

Trying to set up a database connection between a Linux/Ubuntu server (client) and a Windows server (host) using the code below, but it fails for some reason. The ip address is ok (pinged it ok), port 3050 is open and username and password are also correct, so what can be the problem? The code below returns "Connection failed!!!". And yes, the php/interbase library is installed.
$db_path = '192.*.*.*:C:\folder\DBFILE.IB';
$username = 'USER';
$password = 'password';
$dbh = ibase_connect($db_path, $username, $password) or die('Connection failed!!!');
Just an update. It turned out that the connection is ok, and the problem has to do with the username and/or password. The following error is returned by ibase_errmsg()
"Your user name and password are not defined. Ask your database administrator to set up a Firebird login." However, the username and password has be triple checked several times over and should be ok.
I got the same error while trying to connect to interbase XE7(V12) using php ibase_connect.My interbase server was hosted in a windows 10 machine.
Make sure the php/interbase library is installed and listed in result of get_loaded_extensions().
For my case the problem was in the interbase password digest. For older interbase it uses 'des-crypt' digest and for newer version it uses 'sha-1' digest. I just changed the password digest to 'des-crypt' then it worked.
Here is the steps to change the password digest for interbase using isql.exe .
Find the admib.ib in here C:\ProgramData\Application Data\Embarcadero\InterBase\gds_db or under c:\program files then follow the instructions
1. SQL> CONNECT "C:\Program Files (x86)\borland\interbase\admin.ib" (hit enter)
2.CON> user 'SYSDBA' password 'masterkey';
3.SQL> ALTER DATABASE SET PASSWORD DIGEST 'DES-CRYPT';
4.SQL> UPDATE USERS SET PASSWORD_DIGEST = 'DES-CRYPT' WHERE USER_NAME='sitesync';
5.SQL> COMMIT;
Then open gsec.exe and type these command
gsec -user sysdba -password masterkey (hit enter)
modify sitesync -pw newpassword (hit enter and password changed)
Back to sha-1 again
6. SQL> ALTER DATABASE SET PASSWORD DIGEST 'SHA-1';
7 commit;
And that's it. Please be noted I worked for the first time with php and interbase. Please pardon me for any missing details or typos.
Could it possibly be that the backslashes need to be escaped into C:\\folder\\DBFILE.IB and that otherwise the C:\folder\DBFILE.IB is translated to garbage path, which IBASE doesn't find and gives the rather imprecise error msg?

XPEnology phpMyAdmin cannot log in to mysql

Installed XPEnology operating system, and using package manager installed MariaDB and phpMyAdmin.
Tired to login to phpMyAdmin http://WEB/phpMyAdmin and receiving a 'Cannot connect to local server' error message.
In the control panel enable SSH.
Login to SSH using Putty (http://www.putty.org), using the username and password you originally set up the XPEnology with.
Issue this command, changing the *** to your password
mysqladmin -u root password *******
You should now be able to login to phpMyAdmin on Synology. Username should be 'root'

Cannot connect remotely to mysql server via heidisql

i am new to MySQL and php and i cannot seem to obtain a remote connection to mysql server via heidisql and i can get a connection via the command line shell included in the mysql client the following is the error message
SQL Error (1045) in statement #0: Access denied for user
'root'#'localhost' (using password: YES)
this message occurred once i typed in -hlocalhost -uroot -pascent in the DOS box. Any pointers would be very much appreciated. Would i have to run the mysql_install_db script to initialise privilges as i am 100% sure my password is correct.

Connect to MSSQL with PHP (Linux)

Debian 7 x64, MSSQL 2008
Installed:
PHP 5.4.36-0
FreeTSD 0.91
unixodbc
If I connect with:
tsql -S server_name -U user_name -P password -D db_name
all is ok, but if I try to connect via php:
mssql_connect('server_name', 'user_name', 'password')
it always says
Login failed for user 'user_name'. (severity 14)
Can anyone help me with this? Thanks.
update: Found a solution: make the password shorter and everything was fine. Old password contains 32 characters.
Did you check this?
"To increase security, the error message that is returned to the client deliberately hides the nature of the authentication error. However, in the SQL Server error log, a corresponding error contains an error state that maps to an authentication failure condition. Compare the error state to the following list to determine the reason for the login failure."

Error connecting PHP to MariaDB database

I am trying to create a simple web app that prints out database info from MariaDB/MySQL using PHP, im not even at that stage yet... I have trouble when connecting to the database and get the following error:
Host '10.155.237.62' is not allowed to connect to this MariaDB server
Now,
I have not done a secure installation so my Mariadb Server allows access from wildcard host and infact any host.I have also tried the code with the root account but received the same error. Can anyone tell me if its my code or whether its a procedure im not aware of that disallows connectors to access the information?
Here is my code:
<?php
$con=mysqli_connect("vm-007.server.com","testuser","testpass","my_db");
if (mysqli_connect_errno())
{
echo "Failed to connect to MariaDB: " . mysqli_connect_error();
}
?>
Thanks in advance!
i would test your mysql database access from command line from remote machine
mysql -h vm-007.server.com -u testuser my_db -p
it will ask you for a password and type that in.
If it fails then you are probably dealing with a mysql setup problem.
likely you are dealing with something like the mysql daemon only listening to the localhost interface i.e. 127.0.0.1 . Even if it allows access from any host if it isn't listening to a give interface like eth0 it doesn't matter.
If you have not created a database, do it from a cmd prompt:
CREATE DATABASE blobblablob;
Now use the USE keyword for that name like so:
USE blobblablob;
Now give yourself permission to use your database:
GRANT ALL ON 'blobblablob' TO 'me'#'localhost' IDENTIFIED BY 'mypassword';
Don't forget to end all your statements with a ; (semicolon).
Now get out of the cmd prompt by typing exit.
You can check in your browser your PHP scripts. They should start working for that database now
since you have the controluser permissions.
Go to user account->add user account->create account with user name and password... let host name be %...click ok
click privileges on created user and grant global permission.
then change ur localhost name as ip:192.168.3.2 and username as newcreatedusername and password .... save it.
open your application from any other remote system along with ip:port ---192.168.1.2:9090/dashboard/working-files/welcome.php-------press enter

Resources