Jump to content
Sign in to follow this  


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>

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

Share this post

Link to post
Share on other sites
jim read

I am no expert. But MySQL does have a way to limit access or even block it completely from remote machine.

Is you MySQL server on windows or Linux?

Based on that it would be simpler to help you find out how to allow your user to access your database

Share this post

Link to post
Share on other sites

Did you do this on your mysql server?

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



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';

Share this post

Link to post
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
Sign in to follow this