I am on windows using Xampp
I want to upload a file on shiny, but I receive this error; Access denied for user 'myusername'#'localhost' (using password: YES)
This is what I have in R:
mysql = list(
"host" = "127.0.0.1",
"port" = 3306,
"user" = "myuser",
"password" = "mypassword"
“databaseName" = "xxx"),
Could someone tell me how to fix it?
Thanks a lot
You could create a user specially for your shiny application and give this user proper privileges. If you can access a terminal / MySQL workbench where you can type in SQL commands you could try:
Start by creating the user:
CREATE USER 'shinyuser'#'%' IDENTIFIED BY 'password123';
The create the database if necessary:
CREATE DATABASE MyDatabase;
And finally give permission to the new user:
GRANT ALL PRIVILEGES ON shinyuser.* TO 'MyDatabase'#'%' WITH GRANT OPTION;
This problem arises when your username and password is not matching with your database username and password. So please check your database username and password first then try it again.
Related
I am using gAdmin on mac. So far I have not been able to figure out how to run the desktop version, so I am running the web application. I want to change the password for the user postres. The reason being, I am trying to connect R to postres using:
db <- 'dvdrental' #provide the name of your db
host_db <- "localhost"
db_port <- '5432'
db_user <- "postgres"
db_password <- " " # I typed the master password in, as I do not remember setting up this user/password
con<-dbConnect(RPostgres::Postgres(), dbname = db, host=host_db, port=db_port, user=db_user, password=db_password)
but I keep getting below error:
Error: FATAL: password authentication failed for user "postgres".
This is thee reason for the change of password for the user postgres
How can I change a user password in PgAmin4 using webapp on mac?
In PgAdmin4, if you are changing the password for the same user you are logged in as, then you need to select a connected database from the browser tree. Once you do that, the "Object" menu "Change Password..." option.
If you are logged into the server as a super user and want to change the password of a different user/role, then right click (or whatever mac uses for that function) on that user/role from the tree and choose "Properties...". Then under the "definition" tab there is a place to enter the new password. Note that this method is inferior, as the password is received by the server as plain text (once any ssl decryption is done) and so can end up in the log file in the clear.
Why constrain yourself to PgAdmin4? psql has \password, which does this better.
I am using mongo replicaset through my meteor app.
Here is my connection string and code:
var collectionsDB = new MongoInternals.RemoteCollectionDriver("mongodb://usr:pwd#10.9.111.111:27017,user:pwd#10.9.111.112:27017,use:pwd#10.9.111.113:27017/myDB?replicaSet=myRelicaset&authSource=myDB&readPreference=primaryPreferred&w=1");
coll = new Mongo.Collection('<myCollection>',{ _driver:collectionsDB });
Problem:
When I am trying to insert to mongoDB, it tries to insert into Admin db rather myDB. The user usr has readwrite permission for myDB. I fail to understand why it is targeting Admin. As it does not have permission in Admin it through permission error.
However it works fine for individual mongo server without replicaset.
Any thing I am missing in connection string?
thanks
Nihar
I have forgotten my Oracle username and password and hence not able to use it. My Oracle version is 11.2.0.1.0(11g). I consulted Internet. They asked me to execute commands like ‘SYSDBA’ but I was unable to do it as once I give ‘SYSDBA’ on Command Prompt screen, it takes the command as the username and next asks for password. I cannot execute any commands suggested by them as whatever I enter is taken as the username, subsequently password is asked and error occurs.
Open your SQL command line and type the following:
SQL> connect / as sysdba
Once connected,you can enter the following query to get details of username and password:
SQL> select username,password from dba_users;
This will list down the usernames,but passwords would not be visible.But you can identify the particular username and then change the password for that user.
For changing the password,use the below query:
SQL> alter user username identified by password;
Here username is the name of user whose password you want to change and password is the new password.
Go to SQL command line:-
type:
sql>connect / as sysdba;
then type:
sql>desc dba_users;
then type:
sql>select username,password from dba_users;
If sysdba doesn't work then try connecting with username:scott and password: Tiger
You will be able to see all users with passwords.
Probably you might find your's.
Hope this helps
Open Command Prompt/Terminal and type:
sqlplus / as SYSDBA
SQL prompt will turn up. Now type:
ALTER USER existing_account_name IDENTIFIED BY new_password ACCOUNT UNLOCK;
Voila! You've unlocked your account.
The usernames are shown in the dba_users's username column, there is a script you can run called:
alter user username identified by password
You can get more information here - https://community.oracle.com/thread/632617?tstart=0
if you are on Windows
Start the Oracle service if it is not started (most probably it starts automatically when Windows starts)
Start CMD.exe
in the cmd (black window) type:
sqlplus / as sysdba
Now you are logged with SYS user and you can do anything you want (query DBA_USERS to find out your username, or change any user password). You can not see the old password, you can only change it.
I use R and trying to use the very recent "Mongolite". However I cannot connect to MongoDB server.
The manual clearly states the following:
mongo(collection = "test", db = "test", url = "mongodb://localhost")
This is what I have tried without success, where I have a log token and the port of course.
mongodb://heroku:TOKEN#lennon.mongohq.com:PORT
and keep getting the following error:
Error in mongo_collection_new(url, db, collection) :
Failed to authenticate credentials.
It is tried and true that mongolite (v0.7 as of today) supports authenticated connection to a remote 3.2.x MongoDB (as opposed to localhost).
The example below jeroenooms provides himself worked:
library(mongolite)
mongo(collection = "mtcars", url = "mongodb://readwrite:test#ds043942.mongolab.com:43942/jeroen_test")
To explain:
mtcars is the name of the MongoDB "collection" (or "table" if you insist). It could be a name that does not exist yet.
readwrite is the user name of your mongodb
test is the password of the user "readwrite"
ds043942.mongolab.com is the remote host, which could be replaced by ip address, i.e. 23.20.234.21
43942 is the port number. By default in MongoDB, it is 27017
jeroen_test is the name of the database instance in use, which has to exist already
Running the commands above in R will print:
Mongo Message: SCRAM: authenticating "readwrite" (step 1)
Mongo Message: SCRAM: authenticating "readwrite" (step 2)
Mongo Message: SCRAM: authenticating "readwrite" (step 3)
Mongo Message: SCRAM: "readwrite" authenticated
...
I tried to replace it with my own remote host info. It didn't work in the beginning, which turned to be the user role issue rather than mongolite issue. After ensuring a user with correct readWrite roles, I connected to my remote 3.2.x MongoDB via mongolite package.
The following 2 sources were of great help to me in setting up users in MongoDB:
enable-authentication
Manage User and Roles
If you look into the source code of jeroenooms/mongolite you can see that it doesn't support authentication yet:
https://github.com/jeroenooms/mongolite/blob/master/R/mongo.R
mongo_collection_new <- function(uri = "mongodb://localhost", db = "test", collection = "test"){
stopifnot(is.character(uri))
stopifnot(is.character(db))
stopifnot(is.character(collection))
.Call(R_mongo_collection_new, uri, db, collection)
}
just change the order :
mongo( url = "mongodb://localhost",db = "test",collection = "test")
I found that the following command allowed me to connect to mongodb using mongolite and the legacy SCRAM-SHA-1 authentication mode.
library(mongolite)
mongoUrl <- "mongodb://a_username:a_password#localhost:27017/admin" #<-admin here is the mongodb database that stores the authentication info
# specify your collection
colname <- "a_collection"
# specify your database
dbname <- "a_database"
# create connection (con)
con <- mongo(collection = colname, url = mongoUrl, db=dbname)
# count how many records (fyi this is just a test)
con$count('{}')
I am using Oracle SQL Developer to connect to Oracle Express 11g and create a new user. I keep on getting the same error when I try to create a new connection (and test it) or when I try to login with a newly created username and password (mad by right-clicking "other users" table in default connection "xe")
The error-
Failure - Test Failed: ORA-01017: invalid username/password; logon denied
How can I fix this issue ?
Seems you're using an user with not enough privilegies, try with "system" user.
That should solve your problem.
Verify the priviligies of the user you created.