Well, today we will analyze its a p i. First, we will look at a function, which is the initialization of MySQL. When we did the demonstration code earlier, we have added this MySQL internal. In fact, this internal does several things, including the initialization of the library, and our corresponding multi thread initialization, Then there is our own object, Malaysia, which is used to store the initialization of our communication context and database communication context, so it will have several steps, and then it will call this mysql library in nature, and this function will only be called once, So if we are in the case of multithreading, we can manually call this function once, and then we don't need to call it later. Then we should pay attention to the point that MySQL is a function that is not thread safe. That is to say, when you call it in multithreading, Alas, it may be released, but the thread is not safe. Thread safety does not necessarily mean that you can adjust it directly without asking multiple threads to adjust it. Thread safety only guarantees that when multiple threads call the same function, alas, it will not make mistakes or pawn it, but it is like you take data to read data, alas, you switch back and forth between multiple threads, There may still be problems
Suitable for people
1. Students with basic knowledge of C language; 2. Students who have a basic knowledge of C++and want to do practical learning; 3. Used in work or database programming
You will learn
Learn to install and configure mysql8.0 and mysql's official graphical interface in Windows and ubuntu systems, learn the c api of mysql's sql, transactions, locks and stored procedures, and solve problems such as Chinese garbled code and file storage;
Course Introduction
Environmental Science:
Main use of the course C++programming. All demonstration codes are cross platform. The development environment used in the course on the Windows platform is the vs2017 community version, and the Linux environment uses g++and make under ubuntu 18.04.
MySQL uses version 8.0. The official version of MySQL graphical management tool is MySQL Workbench 8.0. The server will demonstrate the installation and configuration in windows10 and ubuntu18.04.
The mysql api uses the ibm ysqlclient, a 64 bit version used in Windows, and is installed directly through apt get in Linux.
Explanation method:
Through mind mapping +The explanation method of code operation. Each function implemented will demonstrate and analyze the code. For details, see the directory and video introduction.
The course provides all the source code to the students.
Expand more