views:

310

answers:

3

I don't know of the default server name. Can you please help me because I need to work on our project to connect vb.net with wamp server, and for that to happen, I must know the server name that I will put on the codes. Please, thanks in advance.

+1  A: 

The WAMP server doesn't maintain a name. You connect to it via an IP address... do you not know the IP of the machine it's installed on?

If it's on your own computer, you can connect to the Sql server from code by connecting to 127.0.0.1:3306 (default port).

If it's not on your machine, find the ip address of the machine it's running on by going to the command prompt and typing 'ipconfig'.

Then use that IP address and port 3306 (or whatever port you defined, 3306 is just default)

Crowe T. Robot
so what then will I put on the server name in this code:Dim connectionString As String = "Driver={MySQL};SERVER=?;DATABASE=student;" 'Dim conn As New OdbcConnection(connectionString)
+2  A: 

Default access will be via localhost or 127.0.0.1. Might not work (rarely) if it was modified before.

The following should work provided (provided mySQL port is default at 3306) :

Dim connectionString As String = "Driver={MySQL};SERVER=localhost;DATABASE=student;

For more variations, check this out.

o.k.w
do i need to simply put localhost or i need to name the localhost?
Yea, put `localhost` literally.
o.k.w
A: 

Just check connectionstrings.com, one of the best resources out there.

Jonas Lincoln