-
Mar 4th, 2012, 08:20 AM
#1
Thread Starter
Lively Member
[RESOLVED] Mysql read-only user
Hi guys,
I have a vb.net project that connects to my mysql server and it works, but only with the root user.
So I've been googling around on how to make a new mysql-read-only-user but as soon as I try to connect with that user on my project I get:
"MySQL: access denied for user: (Using password: YES)".
If I run "Select * from mysql.user" I can see my new account listed, I tried to make the user both localhost and the specific address but still no go.
Any solutions?
Best regards,
Macbrutal
-
Mar 4th, 2012, 08:36 AM
#2
Re: Mysql read-only user
This is a MySQL admin issue and nothing whatsoever to do with VB.NET. I have asked the mods to move this thread to the Database Development forum where it belongs.
-
Mar 4th, 2012, 09:16 AM
#3
Re: Mysql read-only user
Make sure you have entered the password in the connectionstring. Without anycode we can't help you.
-
Mar 4th, 2012, 10:12 AM
#4
Thread Starter
Lively Member
Re: Mysql read-only user
jmc is right, this is irrelevant to the forum. Sorry about that.
Code:
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
conn = New MySqlConnection()
conn.ConnectionString = "server=" & txtServer.Text & ";" _
& "user id=" & txtUsername.Text & ";" _
& "password=" & txtPassword.Text & ";" _
& "database=in_out"
Try
conn.Open()
MessageBox.Show("Connection Opened Successfully")
conn.Close()
Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)
Finally
conn.Dispose()
End Try
End Sub
I've been following the guide from vbmysql.com, yes I'm very sure it's the correct password since I've created several dummy users to be sure that there's no typo.
Here's something else, if I run "Desc select * from mysql.user I don't see any accounts at all.
Code:
mysql> desc select * from mysql.user;
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
| 1 | SIMPLE | user | ALL | NULL | NULL | NULL | NULL | 8 | |
+----+-------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)
but if i run the same command without desc I can see all the accounts for my vps server, and the dummy account I created.
-
Mar 4th, 2012, 10:22 AM
#5
Re: Mysql read-only user
There is no such thing as "Desc select".
("SELECT * FROM yourtable", conn)
You should also convert you textboxes to string: Cstr(yourtextbox.text).
-
Mar 4th, 2012, 11:05 AM
#6
Thread Starter
Lively Member
Re: Mysql read-only user
Thank you Radjesh, I'll dig deeper in that once I figure this out.
The thing is I'm trying to make a program that eventually users will be able to create and login to my project, however I don't want to use my root account in order for this to happend.
-
Mar 4th, 2012, 03:24 PM
#7
Thread Starter
Lively Member
Re: Mysql read-only user
Okay got it, instead of setting the account to localhost or the specific IP address I read that you use "%" which allows everyone to access it.
Thank you everybody.
-
Mar 4th, 2012, 04:37 PM
#8
Re: Mysql read-only user
Thread moved to the 'Database Development' forum
Originally Posted by jmcilhinney
I have asked the mods to move this thread to the Database Development forum where it belongs.
Thanks as always for letting us know
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|