It sounds like a MySQL grant (permissions) issue.
On MySQL servers, you must "grant" a database user @ hostname access to a specific database. This error is states that you connected to the database server, but the user 'example' has no permissions to the database 'test' when connecting from any machine. The '%' is a wildcard, representing ANY hostname/ip address.
I have never been able to connect to the demo database server listed in that lesson, so it could be that RunRev has disabled access to that public database. Or it could be the username/password is fictitious for illustrative use only, never intended to be used.
I suggest installing a copy of MySQL locally on either your development box or a dedicated machine. Another option is using a webhosting company, but many of those restrict from the outside world -- only the actual website being hosted is allowed access.
Once you have a locally running MySQL server, edit these lines in your script where tDatabaseAddress is set to IP address of the machine running MySQL server:
Code: Select all
-- set up the connection parameters - edit these to suit your database
put "192.168.1.4" into tDatabaseAddress -- IP of machine running MySQL server
put "test" into tDatabaseName
put "example" into tDatabaseUser
put "example" into tDatabasePassword
Then you need to create the MySQL user. To do so, login to mysql as its 'root' user and issue something like this:
Code: Select all
CREATE USER 'example'@'%' IDENTIFIED BY 'example';
GRANT ALL ON test.* TO 'example'@'%';
Which says to create a user named 'example', connecting from any machine to be identified with the password 'example'. Then grant all permissions for database 'test' and all of its contents to the newly created example user.
Or to be more secure, you could GRANT restricted to specific client IP (the IP of the machine where your application is running):
Code: Select all
CREATE USER 'example'@'192.168.1.2' IDENTIFIED BY 'example';
GRANT ALL ON test.* TO 'example'@'192.168.1.2';
Sorry, but I don't know enough to make it work. It's me, I know it's me. I'm using RevStudio 4.0.0
I really don't think its you, in this case. The lesson seems vague, lacking anything explicitly stating the listed connection details can't be used, beyond the small blurb in the script comment.