mSQL (mini SQL) is a single-user database management system. Due to its shortness and precision, its application system is especially favored by Internet users. Web management system based on Linux, using mSQL database for data management, can achieve good running results.
The first is download. You can download the latest version of the software for free after registering at www.hughes.com.au.
The installation of mSQL is quite simple. The installation of the binary version (for a software compiled by a hardware platform) is just to expand the file to a directory of the user and then configure several parameters. For example, the file you downloaded is: mSQL-2.0.3.tar.gz. You want to install mSQL into the /usr/local directory. At this time, we need to copy this file to /usr/local and type The command tar zxvf mSQL-2.0.3.tar.gz, this command will expand the compressed file. In general, all files of the mSQL database system are installed in the /usr/local/Hughes directory. The next step is to configure the mSQL database. All you have to do is modify the file msql.conf in the /usr/local/Hughes directory.
In practice, we have changed the most parameters of mSQL-User and Admin-User. mSQL—User indicates the user running the mSQL database service program, and Admin—User indicates the user who can perform privileged operations on the mSQL database system (eg, shutting down the operation of the database server, creating a database, etc.). Therefore, if you want the mSQL server to run as the database user, specify the admin user to perform database operations, and change the line where mSQL_User and Admin_User are located: mSQL_User = database and Admin_User = admin. In addition, you must also change the owner of the files and directories under the Hughes directory to database. After the configuration is complete, log out the current user's identity, re-login to the system with the mSQL-User parameter mSQL-User, and enter the following command in the /usr/local/Hughes/bin directory: ./msql2d &, The mSQL database system is started. As for the installation software with source code, take a look at the README and INSTALL files can generally be successfully installed.
In order to integrate mSQL into the user's application, the mSQL database system provides the user with a C language API library and an interpreter: w3-msql, through the C language API library, you can mSQL is integrated into applications developed in standard C language. With the w3-msql tool, you can embed the mSQL database into the html file by writing a C-like scripting language. Let's take a program example to illustrate.
The function of the following program fragment is to compare the username and password submitted on the browser page with the username and password in the registered-user table. If the username and password are correct, they will be displayed on the page. Successful registration information, otherwise the user registration failed. The method implemented in C language is as follows:
void main(int argc, char argv[])
{
//Resolve the user name and password submitted by the user and save it to the variable username And password-usr
...
//Create a socket with the native mSQL database system
sock=msqlConnect(NULL);
//Select database test
if (msqlSelectDB(sock, "test")==-1)
{ //Output database selection failure information
...
} else
{
sprintf(buff, "select from registered-user where username='%s'", username);
//Query the table registered_user record with username
if (msqlQuery(sock ,buff)==-1)
{
//Output query failed error message
...
}
//Save the query result to The pointer variable of the m-result type res
res=msqlStoreResult();
//The number of records that get the result of the query
n Umrow=msqlNumRows(res);
if (numrow==1)
{
//Get the current record, type: m_row
row=msqlFetchRow(res);
//will The password stored in the table is compared with the password entered by the user
if (!strcmp(password_ur,row[2]))
{
//Output registration success message
} else
{
//Output message with incorrect password
}
} else
{
//Output user name input error message
}
}
//Release the pointer of the query results
msqlFreeResult (res);
//Close the database system socket
msqlClose (sock);
return;
}
The above examples contain the main functions used to integrate mSQL into C programs, which basically meet the needs of the application. If you use the class C language that w3-msql can interpret into the html file, you can achieve the same function. CGI programs written in C language need to be compiled differently. The script language does not need to be compiled. The script is interpreted and executed by the CGI program w3-msql provided by the mSQL database system. The main script code fragment is as follows:
As mentioned above, we need to track and log the operation of each us
Q) What is the compatibility of x3610? Which ones are supported? Q) What is the d
One Cancel Anonymous Access Function By default, the FTP server of Wi
First enter the nginx configuration file directory Please enter the following com
HAProxy load balancer configuration and algorithm
The shell unexpectedly stopped, the reason and solution for Explorer.exe being restarted
Maintaining server stability requires attention to seven major issues
Centos time synchronization method
Tips for Solving DHCP Server Failures Completely
Lifesaving straw talk about server backup and disaster recovery
Expert Tips: How to find out where data center vulnerabilities are located
Server virtualization power saving equation
Interpretation of NEC's X86 fault-tolerant server technology
Win8 system Win key + PrtSc key automatically save full screen screenshot
Windows XP Registry Modifications
Windows Server 2003 practical skills seven
Using Windows Calendar Component in Windows 7
Using Windows 7 monitor calibration results in slow system speed
Microsoft has released Win10 Operation Center API Development Guide Video
Win8/Win7 Tips: Pull out the real murder of C disk space
Win7 system Chrome browser can not display the solution of the web page
Win7 system startup blue screen error how to repair
Win7/win8.1 upgrade win10 official version after reinstalling the system how to do?