Database and Login Setup

only for RuBoard - do not distribute or recompile

Database and Login Setup

This application will maintain its own security tables. The table (or tables) will control who can see what and so on. Because of that, only one application login is, needed and no new logins are allowed at the operating system level. When this application launches, it (the application, not the individual user) logs in to the MySQL server. The login and password the user enters will be compared against application tables, to set the user interface correctly for the given user . The application login and password will be the following:

  • Login: com_user

  • Password: syL0U812

That s syL (case is important), zero, then U812. That is the login the compiled application will use to access the database. From there it will query the security tables for specifics about the user.

Next, the MySQL server on the server machine needs to know which machines on the network will be logging in via the application login (com_user). Specifically, access needs to be granted for those machines to connect to this MySQL server. In the following, einstein is the server machine, and for an example, delfin will be one of the desktop machines. Launch mysql as administrator, and from the mysql> prompt, send this command:

 mysql> Grant All on commish.* to com_user@delfin Identified by "syL0U812"; 

Remember that commish is the name of the database (see the Security Concerns section earlier in this chapter). Also, to test the application and develop it on the server, the same command needs to be sent regarding the server:

 mysql> Grant All on commish.*; to com_user@einstein Identified by "syL0U812"; 

Now all the parameters of the mysql_real_connect() call can be filled out in the database connection code of the application. Note that this will have to be done for every machine that is going to access the commish database. To test the success of the Grant commands, either from the server or a workstation, send this command to see if the MySQL daemon on the server grants access:

 % mysql -h einstein -u com_user -p commish 

The -p means it will request your password. If the previous command works and connects to the database from a remote (workstation) machine, permissions have been set correctly.

only for RuBoard - do not distribute or recompile


MySQL Building User Interfaces
MySQL: Building User Interfaces (Landmark)
ISBN: 073571049X
EAN: 2147483647
Year: 2001
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net