-3

I've never set a password for Microsoft SQL server and when I log in, I log in with localhost, I just write . and it connects me. Now I am building an application in java and I have to connect to my database but since I've never set out a password, I am stuck

dataSource.setUrl("jdbc:mysql://localhost:3306/mpp");
        dataSource.setUsername("root");
        dataSource.setPassword(" _____ ");

What do I write as password?

Mocktheduck
  • 1,333
  • 1
  • 22
  • 43

2 Answers2

0

You could setup your mySQL server with a password. Seen that it is best practice. You know security ans stuff :P

You wont be able to check what it is currently (depending on your install)

But you can reset it see the following answer here to reset for mySQL

Edit after your comment on using Microsoft SQL Server please see the answer here

Community
  • 1
  • 1
Jacques Ramsden
  • 801
  • 5
  • 20
  • Problem is, I tried following the microsoft steps and I can't find my bin, I can't find anything. I have microsoft SQL server and everything is so messed up in the folder... – Mocktheduck Apr 18 '16 at 11:30
  • is there a way to check up my password? Maybe I have one? – Mocktheduck Apr 18 '16 at 11:31
  • Wait you said that you have mySQL server and in the comment above you say you have Microsoft SQL Server? Which one is it? – Jacques Ramsden Apr 18 '16 at 11:33
0

change

 dataSource.setPassword(" _____ ");

to

 dataSource.setPassword("");
Danyal Sandeelo
  • 12,196
  • 10
  • 47
  • 78