I have a instnwnd.sql which is a script file for northwind database installation. I don't know how to install this database. I have tried the procedure http://msdn.microsoft.com/en-us/library/ms227484(v=vs.90).aspx but I could not succeed. The error comes out to be "The user is not associated with a trusted sql server connection" I read some where u can do it using query analyser, but what is the sql statement for that ?? Somebody please help me.
Thanks in anticipation
To overcome the "sa" problem I used this and it worked for me.
C:\Users\UserName>sqlcmd -E -i c:\path\to\instnwnd.sql
The website I got this from is
Install Northwind Database.
When you followed the instructions from the MSDN page, and you ran
osql -U sa -P [password] -i instnwnd.sql
you did see the note about replacing [password] with the actual administrative password you created when you installed SQL Server, right?
Note For [password], type the system administrator password that you
created earlier.
Just open the instnwnd.sql file (which is plain text) in Notepad, copy all the text, and paste it into the query window in SQL Server Management Studio. Then press F5 to run the SQL script.
Related
SQL shell(psql) throws me this error when prompting pasword for user postgress psql: error: could not connect to server: fe_sendauth: no password supplied
tried CMD
C:\Users\myuser>psql
Password for user myuser:
psql: error: could not connect to server: fe_sendauth: no password supplied
C:\Users\myuser>psql -U postgres
Password for user postgres:
psql: error: could not connect to server: FATAL: password authentication failed for user "postgres"
found this 1. answer :maybe is this isue
pgpass.conf file needs to put it to PostgreSQL server and not with pgAdmin (client's dir)?? but cant find such file in explorer
pgAdmin 4 works just fine problem is with psql shell
im on WIN 10 ,anyone have same problem and how to solve it?
PS: i managed to work psql shell by setting pg_hba.config file to
host all all 127.0.0.1/32 md5
for ip4 and ip6 i set trust instade md5 and relaoded Postgress service ,but when i reverted back after seting new pasword to md5 same problem and same error
psql: error: could not connect to server: fe_sendauth: no password supplied
pgAdmin 4 still works
I've installed and uninstalled many times and I have managed to get the desired result in the picture below...
Install postgres without changing anything, except entering a new password and open the sql shell by entering 'psql' in your Windows search menu.
Inside SQL shell, keep pressing enter until it prompts you for your
password which you created on the installer
Type your password here, even though it doesn't look like it is
being keyed in and press enter once done.
It should look like...
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Password for user postgres:
psql (12.2)
WARNING: Console code page (850) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
Install pgadmin from this link pgadmin, enter the password from psql
and you should then see the following...
Click on the server database icon top left and add the password which you entered in psql.
Create a database and get the list.
postgres=# CREATE DATABASE your_database_name OWNER postgres; #Click enter here
CREATE DATABASE #result
postgres=# \l #to get the below datbase list
Go back to pg admin, refresh the browser, and click on the server icon.
Note: Should you need to uninstall/re-install you will need to manually delete the folder where you have installed Postgres and pgadmin. This is even after uninstalling from system settings. For some reason, Postgres folder's don't remove entirely even though you select the option.
I am trying to connect mysql database with mulesoft database connector, but it is giving error while I do test Connection. I am not able to figure out what is wrong I am doing. Could you please put me in right direction?
Please ask for more information you need from me.
The problem you are facing is not because of Mule component.There may be several other reasons at MySQL side.
As you can see that your credentials are processed by MySQL however denied.This suggests that the problem may not be directly
related with credentials because if credentials were wrong the error would have been different then denied.
When credentials are denied, the problem is mostly related with:
Permission issue - Solution >> Grant permission to use "db_name" from "Localhost"
Your connection string looks fine but sometimes string encoding result this error
Some installed components are interfering with MySql -> Check the components installation
Also
LOCALHOST and "machine name" aren't the same to MySQL.
I'd check from the command line that you can connect to localhost:
mysql --user=<user_name> --password db_name
Enter password: your_password
If it fails, connect and run this with the appropriate permissions:
create user db_name#localhost identified by 'db_name';
grant select on <user_name>.* to db_name#localhost;
Never mind :) I found the solution although did not find what the problem was only suspecting that the root was not having any schema privileges ( as shown by MySQL Workbench GUI).
Earlier I was using command line with which I am not well versed; after struggling a little I downloaded MySQL workbench and added one more user with all administrative and schema privileges and used that to connect with Database connector and God Damn!! it's working.
I have posted a related question few days back and provided its answer as well.
I am facing a strange issue, I have 2 servers first one is dev server and second is QA
When I execute the below line on dev server it works fine, but when I execute it on QA, it gives me the error Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON', as I posted in my previous question.
EXEC master.dbo.xp_cmdshell ‘sqlcmd -D db_name -S server_name -i sqlfile’
To resolve the above issue I have provided the username and pwd in the above query and it is working fine on both DEV and QA server. But to provide the username and pwd is not a nice approach as if we will change the server or pwd it directly impacts my query. So I want to execute the cmdshell command without using username and pwd on QA as well.
Can anyone please tell me what I am missing on QA. I have already provided the permissions to cmdshell on QA
ANY QUICK HELP
This is because the user the command runs as is NT AUTHORITY\ANONYMOUS LOGON, and this login does not have access to the DB.
Consider this: everything must run under a user context. Every process needs a to have a windows user owning it.
The SQLCMD you are running - who is the windows user running it? it isn't you. It is the SQL Server service. (do some research on xp_cmdshell)
You first need to do some research on windows service accounts and understand what they are.
Then, some possible solutions:
A. Check what your QA SQL Server service is running as (in the logon tab in services.msc)
B. USe a linked server insteadm which can use your logon instead
C. You might also be able to use some kind of proxy (a windows user to override the SQL Service user just for this pupose) but I haven't investigated that.
I am using wamp server but something happend to it and now there is no way to make it come back to life. I only have access to mysql command line, and i have some important databases there.
How can i export the database using commandline?
please help.
mysqldump -h localhost --routines -u root -p dbname
If the mysql server is not behaving normally, you might have some corrupted tables. It happens usually after an unscheduled restart. mysqldump won't be able to export corrupted tables.
If the mysql server is running, try connecting to it using phpmyadmin and use the built in tools to fix and check the tables
if the mysql server fails to start, check the log files and use the mysql command line tools to fix the issues
myisamchk --silent --force --fast --update-state /var/lib/mysql/dbname/*.MYI
(http://www.thegeekstuff.com/2008/09/how-to-repair-corrupted-mysql-tables-using-myisamchk/)
First try to connect to Mysql server using the command line
mysql -uUsername -p and press enter.This will prompt for password.Enter the mysql server password.
Then use the mysqlcheck command to repair the server in case corruption has occured
COmmand for mysql-check : mysqlcheck --repair --use-frm --all-databases
I think you can just copy the folders of the database to create a backup of MySQL databases.
Used to work.
I have a problem, I'm using windows 7 with MS SQL Server Management Studio Express 2005 although I've lost my administrator/ sa password. Is there a command I can use to reset the password, without the old one?
I can login using windows authenication.
many thanks,
James
Login to the SQL Server computer as the Administrator of that computer. Open Query Analyzer and connect to SQL Server using Windows NT authentication. Run sp_password as shown below to reset the sa password:
sp_password #new = 'will_never_forget_again', #loginame = 'sa'
EDIT:
This is unexpected, as you were able to get in to detach a db, so you must
have some privileges. The message you got:
... is a response to the sp_password command. So when you say you tried to
reconnect with 'sa', can you tell us how you did that?
Also, when using the SQLCMD tool, you have to type GO to execute a command:
SP_PASSWORD #NEW = 'my_password', #loginame = 'sa'
GO
Then you need to exit before you try to reconnect.
Try getting in again, and seeing who you are. So after connecting:
C:\sqlcmd -E -d master
Please run this:
SELECT suser_sname(), user_name()
GO
Also, run this after you obtain your user name and enter your new password per my original answer:
ALTER LOGIN sa ENABLE
GO
In the object explorer, go to Security-> Logins and click on preferences for the "sa"-account. There you can reset the password
Because you can login using your windows authentication then it's pretty easy.
what you need is just
login to your management studio,
on the tree view, expand "security" folder, and also expand the
"Logins" folder,
right click on "sa"
change the password. done