Jump to content

MySQL


bleed
 Share

Recommended Posts

I`ve been trying to find an answer to this problem for two days now, and I really hope there is someone willing to help me reliaze where the problem is.

Anyhow, I have a remote server, database userid and password are set correctly. Wildcard % is in place to allow database access to all. Privilages set to all, and the problem is that when I try to execute a script, or even this snippet, I get an error of "Access denied for user ******* to table username."

I have never used mysql before, so I`m still learning.

Even tho, I`m 100% positive that privs are all set (triple-checked) is it possible that remote server denies access after the certain depth in database?

Thank you.

#include <array.au3>
#include <mysql.au3>

_MySQL_InitLibrary()
If @error Then Exit MsgBox(0, '', "")
$MysqlConn = _MySQL_Init()

$connected = _MySQL_Real_Connect($MysqlConn, "www.******.com","*****_vbuser","*********","******_vbuletin")
If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn))

$yam = "testuser"
$pass = "pass"

;$query = "SELECT * FROM user WHERE username="  & _MySQL_Real_Escape_String($MysqlConn,$yam) & "'"
$query = "SELECT * FROM user.username WHERE username = " & _MySQL_Real_Escape_String($MysqlConn,$yam) & " AND password=" & _MySQL_Real_Escape_String($MysqlConn,$pass) & "'"
MsgBox(0, '', $query)
If _MySQL_Real_Query($MysqlConn, $query) = $MYSQL_ERROR Then
    MsgBox(0, 'Error', _MySQL_Error($MysqlConn))
Else
EndIf
Link to comment
Share on other sites

  • 4 weeks later...

Did you do this on your mysql server?

CREATE USER 'user'@'%' IDENTIFIED BY 'some_pass';

GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Make sure it is '%' for all IP's or the IP you'll be connecting from. Can you run the query locally on the mysql server?

login in with:

mysql -u user -p

use 'databasename';

select * from 'tablename';

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...