Tutorial - How to create a MySQL Login Application
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
marve25 wrote:can you make a tut on how to setup the MySQL, got a lot of errors on itYes, It is very easy.
There is only a few things that need to be done other then installing MySQL to your computer.
1.Install MySQL 5.x.x
2.Open the Port: 3306 in your Firewall - Sometimes you have to do this because the install software doesnt.
If you are wanting other people from the Internet to connect and use your MySQL server then you need to
PortForward or IP Passthought, your external IP to your MySQL server.
(Dont ask me, Because I DO NOT know your modem type or ISP information)
This is also known as your WAN Address and a function your are configuring is called DMZ Mode.
So the DMZ needs to point to your computer.
After you have done this, Re-BOOT your computer so it can change to its new IP Address.
Now, serch for my.cnf (c:\Program Fles\MySQL\...my.cnf) find the line that says:
bind-address = 127.0.0.1
change this to
bind-address = 0.0.0.0
Save my.cnf close your editor.
open a CMD Prompt type: mysql /restart
This will restart the mysql server with its new settings.
NOTE
IF you do not want to allow internat connections to you mysql sever, (Which can be very dangerous if allowed)
Then just install MySQL Server and set the Username and Password for the root User.
Thats it.
To find your ip address:
Open a CMD Prompt: type ipconfig /all HIT ENTER
Look for a line that says IP Address: ###.###.###.###
This will be the IP Address that the MySQL Server will be listening to for connections.
I hope this helps. ON a scale to
1 - being easy
10 - being a nightmare
I give this a 4 or 5 because of having to configure your modem.
Enjoy;
Scottie
i found the problem, bind-adress 127.0.0.1 doesnt exist to me and MySQL using local network to me
It also wont work if your host doesn't allow Remote MySQL connections
Hi, i have a question about how can i list result from a table by example i have modified that tutorial and what i want to do its to get messages.
here its my table structure : and i want to list all result containing the username in the reciever )
Table structure of messages
- ID
(little 5 letters to identify the message for deleting)
- Expeditor
(The expeditor name)
- Reciever
(the reciever name and what i want to list the result)
- Message
(the message goes here)
- Sending date
(the date the message are sent)
can you help me to resolve this i'm stucked at this step
thanks
here its my table structure : and i want to list all result containing the username in the reciever )
Table structure of messages
- ID
(little 5 letters to identify the message for deleting)
- Expeditor
(The expeditor name)
- Reciever
(the reciever name and what i want to list the result)
- Message
(the message goes here)
- Sending date
(the date the message are sent)
can you help me to resolve this i'm stucked at this step
thanks
admin@adosrv.net
Owner of ado-srv.net softwares network.
Owner of ado-srv.net softwares network.
dan2130 wrote:Hi, i have a question about how can i list result from a table by example i have modified that tutorial and what i want to do its to get messages.
here its my table structure : and i want to list all result containing the username in the reciever )
Table structure of messages
- ID
(little 5 letters to identify the message for deleting)
- Expeditor
(The expeditor name)
- Reciever
(the reciever name and what i want to list the result)
- Message
(the message goes here)
- Sending date
(the date the message are sent)
can you help me to resolve this i'm stucked at this step
thanks
Table structure of messages
- ID
- Expeditor
- Reciever
- Message
- Sending date
OK we are using the "reader()" method to retreive data from the database.
From you table above the read() will look like this
Code: Select all
All this does is asign a value for each column in your database table.reader.getstring(0) 'ID
reader.getstring(1) 'Expeditor
reader.getstring(2) 'Reciever
reader.getstring(3) 'Message
reader.getstring(4) 'Sending date
So if ID is the first coloumn in your table then, the first reader()
will be reader.getstring(0)
To do a loop
Code: Select all
Select all data from database by username.
While reader.Read()
reader.getstring(0)
End While
Code: Select all
I hope this helps. But this is the best way of retreiving data from a mysql database in a vb 2008 application.Try
Dim query As String = "SELECT * FROM users WHERE username='" + txtUsername.Text + "';"
Dim connection As New MySqlConnection(connStr)
Dim cmd As New MySqlCommand(query, connection)
connection.Open()
Dim reader As MySqlDataReader
reader = cmd.ExecuteReader()
reader.Read()
If reader.HasRows = True Then
reader.getstring(0) 'ID
reader.getstring(1) 'Expeditor
reader.getstring(2) 'Reciever
reader.getstring(3) 'Message
reader.getstring(4) 'Sending date
MsgBox("You have messages!")
Else
MsgBox("Sorry! You have no messages!")
End If
reader.Close()
connection.Close()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Scottie1972
and can i list that results in a listbox becose the reciever can get more than 1 message
admin@adosrv.net
Owner of ado-srv.net softwares network.
Owner of ado-srv.net softwares network.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023