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.
Related
I am using microsoft jdbc for connecting to azure sql. Below is the java code :
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url = String.format("jdbc:sqlserver://***.database.windows.net:1433;database=<my database name>;user=test#abc.com#xyz-url-dev-123abc;password=***;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;");
Getting error SQLServerException: Login failed for user 'test#abc.com' (user name is changed with same format).
Is # causing problem ? Because for user parameter I am sending 'user#url' which is test#abc.com#xyz-url-dev-123abc
Let me know if I am making sense!
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
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'm developing chat application, I'm using ejabberd for my project. I installed ejabberd server(16.06) successfully and it performing good in auth method as internal. But it is not working when I'm changed auth method as sql. These are the things I'm changed in ejabberd.yml file
default_db: sql
auth_method: sql
## ODBC compatible or MSSQL server:
##
sql_type: mssql
sql_server: "Server=azure_server_name;DSN=DB_Name;UID=azure_DB_username;PWD=azure_DB_password"
sql_pool_size: 10
sql_keepalive_interval: 28800
mod_mam:
iqdisc: one_queue
db_type: sql
default: always
I'm getting following error for while I'm register new user and admin login into web admin portal
ejabberd_auth:is_user_exists:316 The authentication module ejabberd_auth_sql returned an error
when checking user <<"newuser">> in server <<"localhost">>
Error message: {timeout,{p1_fsm,sync_send_event,[<0.390.0>,{sql_cmd,{sql_query,{sql_query,<<"Q9525209">>,#Fun<sql_queries.9.38301790>,#Fun<sql_queries.10.38301790>,#Fun<sql_queries.11.38301790>,{sql_queries,145}}},3534866},60000]}}
I'm used register command:
bin>ejabberdctl register "newuser" "localhost" "password"
Thanks in advance. Please add your ideas and suggestions to resolve this issue.
Again- I am no Ejabberd expert- I imagine someone might have more experience with this; However, it seems that you're confusing Register which I assume is an action to create a login on the Ejabberd platform with the login that is being used on the database. (Or I'm misinterpreting your comments. One of the two.)
You will need to use a username/password combination that exists on the Azure SQL Database in your connection string.
Additionally, you might try the following connection string :
sql_server:"Server=tcp:azure_server_name.database.windows.net;DSN=DB_Name;UID=azure_DB_username;PWD=azure_DB_password"
I cannot connect to my local sql server using the following line
conn = SqlConnection("server=(local);uid=tedpottel;pwd=#######;database=by")
I have security set to Windows Authentication , so my other programs (reporting services and cold fusion do not take in a password. (as long as I log in as tedpottel) So I tried
conn = SqlConnection("server=(local);database=by")
which said "failed for user''"
If you do windows authentication, you don't need userID and password
You need to add ;Trusted_Connection=True, it would look like this
Server=(local);Database=by;Trusted_Connection=True;
see here http://connectionstrings.com/sql-server-2008
Are you sure that you have Mixed Authentication enabled:
and are you sure that you are typing in the password correctly as well?