I am trying to connect to a psql database from octave but getting a peer authentication failed error.
error: FATAL: Peer authentication failed for user
error: PQ connection attempt failed
check your pg_hba.conf file I think in that file there is no entry of your current user.
or see the link
Related
I have Two users (User-A, Administrator) in same Domain. How can I Invoke remote Command by logging as User-A and execute that command using Administrator credential without running powershell as administrator?
I'm having an issue with my Plesk installation. When I attempt to manage my database it says "The server is unavailable". When I try to create a new database it gives the following error:
ERROR: SQLSTATE[HY000] [2002] No connection could be made because the
target machine actively refused it
I've already tried restarting the Plesk SQL service. I've also tried repairing Plesk via the command line tool but it gives the same error.
Does anyone know what could be the problem? Or where I can find more logs to get a more specific error?
I have read a number of questions discussing auth problems with MySql 8 however my problem persists. I removed ALL docker containers and created a new Laravel application, and here's what happened.
curl -s "https://laravel.build/example-app" | bash
The above command installed the application as expected.
cd my-app
./vendor/bin/sail up
The above command installed the docker images and spun them up. When I go to http://localhost I can see my application running, and I can access MySql from MySql Workbench using the default username (sail) and password (password).
php artisan migrate
The above command gives an error message as follows.
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known [...]
In Laravel's env file I updated the value of DB_HOST to 127.0.0.1, then tried the command again.
php artisan migrate
The above command gives a different error message this time around.
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client [...]
After Googling about I access MySql as root, and try to modify the authentication method for the sail user, as follows.
ALTER USER 'sail'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
The above command gives as error message as follows.
ERROR 1396 (HY000): Operation ALTER USER failed for 'sail'#'localhost'
I tried this from MySql Workbench, and from the command line of the MySql container. I tried flushing privileges, but that didn't help.
I then tried modifying the authentication method for the root user.
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
This worked fine. However, I then updated the user to root in my application, flushed privileges, and ran the migration again, only to receive the same error message.
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client [...]
The Laravel version is 8.48.1 and the MySql version is 8.0.25.
How can I access MySql from my application?
This turned out to be VERY simple.
When you are executing artisan commands with Sail, you need to preface them with 'sail'. The correct way to run the migration above is:
./vendor/bin/sail artisan migrate
More details here: https://laravel.com/docs/8.x/sail#executing-artisan-commands
Try installing JasperServer 6.3.0 on CentOs 7, when I execute ./js-install-ce.sh
I got this message error:
BUILD FAILED
/opt/jasperreports-server-cp-5.6.0-bin/buildomatic/bin/validation.xml:494:
The following error occurred while executing this line:
/opt/jasperreports-server-cp-5.6.0-bin/buildomatic/bin/validation.xml:375:
The following error occurred while executing this line:
/opt/jasperreports-server-cp-5.6.0-bin/buildomatic/conf_source/db/mysql/db.xml:65:
The following error occurred while executing this line:
/opt/jasperreports-server-cp-5.6.0-bin/buildomatic/bin/validation.xml:433:
The following error occurred while executing this line:
/opt/jasperreports-server-cp-5.6.0-bin/buildomatic/bin/validation.xml:469:
Database doesn't exist. Treating problem with JDBC connection as unrecoverable
Please if you have any suggestion will be appreciated.
Regards
I have fixed by my own, the solution was configuring a user on MySQL with all privileges and open port 3306 on the server
I'm trying to install Jasper Server CE 6.2 by following steps specified in JasperReports-Server-CP-Install-Guide.pdf file (3.2 Installing the WAR File Using js-install Scripts)
After updating default_master.properties, when I try test run using js-install-ce.bat test command, then I'm getting below error (extracted from log)
Error Details
do-install-upgrade-test:
[echo] Checking DBMS host and port:
[echo] About to validate port: mysql-db.company.com:3306
[echo] Port 3306 is OK
[echo] Done validating port: mysql-db.company.com:3306
[echo] Validating administrative database connection at jdbc:mysql://mysql-db.company.com:3306/mysql. Phase: [test]
[echo] For JDBC driver the artifactId and version properties are set:
[echo] maven.jdbc.artifactId=mariadb-java-client
[echo] maven.jdbc.version=1.1.2
[echo] Specified JDBC driver jar exists
[advanced-sql] Failed to connect: Could not connect: Access denied for user 'jasper_admin'#'%' to database 'mysql'
[echo] Connection failed:
[echo] SQLState: HY0000
[echo] Vendor specific error code: -1
[echo] Message: [Could not connect: Access denied for user 'jasper_admin'#'%' to database 'mysql']
BUILD FAILED
E:\Software-Downloads\jasperreports-server-cp-6.2.0-bin\jasperreports-server-cp-6.2.0-bin\buildomatic\bin\validation.xml:495: The following error occurred while executing this line:
E:\Software-Downloads\jasperreports-server-cp-6.2.0-bin\jasperreports-server-cp-6.2.0-bin\buildomatic\bin\validation.xml:376: The following error occurred while executing this line:
E:\Software-Downloads\jasperreports-server-cp-6.2.0-bin\jasperreports-server-cp-6.2.0-bin\buildomatic\conf_source\db\mysql\db.xml:65: The following error occurred while executing this line:
E:\Software-Downloads\jasperreports-server-cp-6.2.0-bin\jasperreports-server-cp-6.2.0-bin\buildomatic\bin\validation.xml:434: The following error occurred while executing this line:
E:\Software-Downloads\jasperreports-server-cp-6.2.0-bin\jasperreports-server-cp-6.2.0-bin\buildomatic\bin\validation.xml:470: Database doesn't exist. Treating problem with JDBC connection as unrecoverable
DB Details from default_master.properties file
# database type
dbType=mysql
# database location and connection settings
dbHost=mysql-db.company.com
dbUsername=jasper_admin
dbPassword=jasper_admin_password
# additional database parameters
# (uncomment these if you want non-default settings)
dbPort=3306
# JasperServer db name, sample db names
js.dbName=jasper
# sugarcrm.dbName=sugarcrm
# foodmart.dbName=foodmart
Note: User jasper_admin already exists in DB and this connection is tested successfully. Database jasper exists as-well.
I can't connect as root access! Please suggest me if there is any work-around.
Thanks a ton in advance for your help.
[update] In error log, I can see below error
Could not connect: Access denied for user 'jasper_admin'#'%' to database 'mysql'
but where I can see what code Jasper build scripts are using to verify this? because, I can connect to MySQL DB using same user via MySQL Client.
Issue was with MySQL user "jasper_admin". This user should have access to internal database mysql. Best case is try installing Jasper using MySQL "root" user.