C++ Server Setup

C++ Server Setup

MySQL 5.6 32-bit

  1. Download the MySQL 5.6 32-bit from download.
  2. Unzip the archive file at C:\Program Files in Windows 7.
  3. Modify the system environment paths by appending C:\Program Files\mysql-5.6.34-win32\bin after path.
  4. Open the terminal as the Administrator and cd C:\Program Files\mysql-5.6.34-win32\bin and then add MySQL service by command mysqld --install MySQL --defaults-file=C:\Program Files\mysql-5.6.34-win32\my-default.ini.

    If you would like to modify the default settings of the mysql service you can modify the my-default.ini before the previous command reference.

  5. Start the newly added service mysql by net start mysql.

  • If you cannot start it, perhaps the setting file is not right. Set the mysql service in the service panel services.msc to manual and then restart the computer.
  • Remove the mysql service by sc delete mysql and then run the service installing command mentioned in step 4 again.
  1. Start the service by net start mysql.
  2. Set password for the root by update mysql.user set password=password("onceas") where user='root' and flush privileges.

    But if you are prompted that you have no authority to access then you should try to stop the service first net stop mysql and start it net start mysql and then reset the password as the above commands.

Configure MySQL in VS 2012

  1. New a Win32 project first.
  2. Open the attribute page of the project, append C:\Program Files\mysql-5.6.34-win32\include to VC++ Directories -> Include Directories and append C:\Program Files\mysql-5.6.34-win32\lib and C:\Program Files\mysql-5.6.34-win32\lib\debug to VC++ Directories -> Library Directories.
  3. Copy the libmysql.dll from C:\Program Files\mysql-5.6.34-win32\lib to the debug folder of the current project similar to Server\debug.
  4. Then try the following test code:
1
2

Configure Jsoncpp in VS 2012

Configure pthread in VS 2012

Always welcome new ideas and practical tricks, just leave them in the comments!