Results 1 to 8 of 8

Thread: [RESOLVED] Mysql read-only user

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    Resolved [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    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.

  3. #3
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Mysql read-only user

    Make sure you have entered the password in the connectionstring. Without anycode we can't help you.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    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.

  5. #5
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    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).


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    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.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    91

    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.

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Mysql read-only user

    Thread moved to the 'Database Development' forum
    Quote Originally Posted by jmcilhinney View Post
    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
  •  



Click Here to Expand Forum to Full Width