Pls I have downloaded postgresql for Windows and I want to connect my models in Django model file to postgresql database but it keep throwing that error
Name : "django 1",
User: "postgresql",
Password: "bless90",
Host: "local host"
The result of those type of error is when u used a wrong word while passing the database config like the Name,User,Host,and password but for my case I used postgresql instead of postgres
Related
I'm trying to implement an application that connects to online database using API. I've created a server and a database on freesqldatabase.com with the credentials of a sort
Host: sql7.freesqldatabase.com
Database name: sql12345678
Database user: sql12345678
Database password: passwordqwertyasdfgh
Port number: 3306
Now I'm trying to connect to the database using a postman. In the url I have sql7.freesqldatabase.com/sql12345678/nameOfATable,
data as a json file:
{
"id" : 1,
"login" :"user",
"password" : "12345",
"data" : "RandomData"
}
In Auth I've also entered the username and password provided above for a basic authentification. However, when I'm trying to connect using POST / GET methods of postman, it always fails with "Request timed out". If I change the url by inserting a port number, Postman doesn't send it neither. Where could be the problem? If the server is not accessible, is possible to make it accessible using phpadmin.co? I have the access to the server / database there through phpadmin.co.
Note that the data and the types of variables are correct, so I don't think the problem is there. Anyway, I'd be glad for any help provided.
i want just to host a website previously work , into another web server
i have change parameters.yml file with new host parameteres of connection
i have upload all my files , and i have import my databases
when i try to enter (myhost/web ) i have this errors : Access denied for user 'root'#'localhost' (using password: NO)
error.log
[07-Dec-2022 15:30:13 Africa/Algiers] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'#'localhost' (using password: NO)' in /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=127....', 'root', NULL, Array)
#1 /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(45): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=127....', 'root', NULL, Array)
#2 /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'root', NULL, Array)
#3 /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): Doctrine\DBAL\Connection->connect()
#4 /home2/icares/logicom.dz/ncomparer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): in /home2/icares/logicom.dz/ncomparer/app/cache/prod/classes.php on line 3390
I have change the parameters of connection with new server , but the error is that username root password no and server is localhost , what i must do ?
The error.log says that your Symfony trying to access database (probably MySQL) via the user 'root' from a local host. But your database, MySQL is not set to allow access as 'root'.
MySQL and most databases do not allow to access as 'root' as default as security reason, especially without password (what your erro said).
So, may be you need to check:
What is your database_user and database_password set in Symfony project (parameters.yml?)
Check MySQL from cli that what kind of previleges are set for your database.
The way to access mysql without password may find here:
Allow linux root user mysql root access without password
Or some hints may be here:
How to create a root user with no password in mysql
I have a rails 4.2 application with postgres database which is running. I have requirement to connect with other databases (word_press_sites) on demand basis.
I have tried the below code this into rails console:
ActiveRecord::Base.establish_connection(
adapter: "mysql2",
host: ENV["HOST"],
username: ENV["USERNAME"],
password: ENV["PASSWORD"],
database: ENV["DB_NAME"]
)
above code results,
No error, connected to the word_press database_tables.
1) If am trying to access the table by calling User.all in my rails application db i can not able to access which is throwing an error.
After opening the rails console you can check
ActiveRecord::Base.connection.current_database
This will give the current db info,Then try the script you have given
ActiveRecord::Base.establish_connection(
adapter: "mysql2",
host: ENV["HOST"],
username: ENV["USERNAME"],
password: ENV["PASSWORD"],
database: ENV["DB_NAME"]
)
Now try the same command
ActiveRecord::Base.connection.current_database
This will give the newly connected ActiveRecord connection
Which means Active record is shifted into newly connected wordpress database so that you can not able to access the table in your rails application database
If you want to revert back to your rails app db you can do this
ActiveRecord::Base.remove_connection( ActiveRecord::Base)
Let me know if you need more information
I am a Database Workbench fan from way back, but bizarrely have not used it for quite awhile.
I downloaded a trial version and am trying to "Register Server" as a first step.
The problem is I don't know what to use for which properties. I need to know:
Alias
Host
Instance
With "Use SQL Server Authentication" checked:
Username
Password
I've tried to guess my way through what is needed where, but nothing has worked.
I can connect to the database in (C#) code with this connection string:
"SERVER=PlatypusSQL42;DATABASE=duckbilldata;UID=youinnocentdog;PWD=contrasena;Connection Timeout=0";
And so I have tried these values:
Alias: DBWBSQLServer
Host: PlatypusSQL42
Instance: duckbilldata
Username: youinnocentdog
Password:contrasena
..and this:
Alias: PlatypusSQL42
Host: duckbilldata
Instance:
Username: youinnocentdog
Password:contrasena
...but with both of them, I get, "[DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found."
What values are needed?
The instance is not the database in the server you are connecting to. You can actually have more than one Sql Server running in the same operating system. You're using the default instance, so don't use that field or leave it blank.
Host: PlatypusSQL42
Username: youinnocentdog
Password:contrasena
I installed oracle 11g in my machine and created tablespaces and user.
Evereything ran succesfully. Now im trying to create a new conenction thru sqlDeveloper but i get this error. I checked the SID name and changed them according to tnsnames.ora. what else might go wrong?
Don't use the tnsnames.ora and set the connection type to "Basic".
Enter your connection details (SID, Port, host, username and password) accordingly.
Use connection type basic, and dont use hyphen "-" in the connection name, while use underscore "_". and then try again to connect
If the database is on your machine, and you're still talking about 11g, then you can simply do this:
Connection Type: Basic
Hostname: localhost (you said it the db was on YOUR machine, yes?)
Port: 1521 (this is the default unless you changed it)
SID: orcl for regular db or xe for Express edition
Service Name: use this if 12c with Pluggable Database
Or course for username and password:
username: system (a default ADMIN account, less dangerous than SYS)
password: whatever you provided when creating your database
If you are going to login as SYS, you must change the Role from default to SYSDBA.
If you have TNSNames.ora file, we should find it, and you can set your Connection Type to TNS, and simply pick your database from the dropdown.
As you can imagine, when you have MANY databases, the TNS path is much easier, but you will need to maintain this file. Otherwise, Basic is the easiest way to go.