Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 642408d

Browse files
Update README.md
1 parent affaa6a commit 642408d

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

‎README.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,7 @@ By Default g++ uses clang compiler which comes with Xcode which is not a genuine
1414
4. sudo port select --set gcc mp-gcc46
1515
5. Now check again gcc --version it should Say (gcc (MacPorts gcc46 4.6.4_11) 4.6.4) ...
1616

17+
..................
1718

18-
Installing and running mysql
19-
1. brew install mysql
20-
2. g++ -o demo1 -I/usr/local/include -I/usr/local/include/mysql -W -lmysqlclient -L/usr/local/lib demo1.cpp
21-
3. Run ./demo1
2219

23-
### Using Mysql Connector CPP
24-
STEP 1 - Connector
25-
1. Download Mysql C++ Connector for Mac OS from here https://dev.mysql.com/downloads/connector/cpp/
26-
1. Extract cppconn direcotry and mysql_connection.h, mysql_driver.h, mysql_error.h file to the root direcotry of your application
27-
28-
STEP 2 - CREATE DYLIB file from cpp connector using the same compiler we are using to compile our code
29-
git clone https://github.com/mysql/mysql-connector-cpp .
30-
git checkout 1.1
31-
git tag
32-
git checkout tags/1.1.9
33-
which g++
34-
which gcc
35-
cmake -DCMAKE_C_COMPILER=/opt/local/bin/gcc -DCMAKE_CXX_COMPILER=/opt/local/bin/g++ .
36-
make
37-
make install
38-
You should find dylib files in driver director and copy those files to the same directory where your code exists
39-
40-
STEP 3 - RUNNING CODE
41-
g++ -o demo -I/usr/local/include -I/Volumes/D/www/c++ -L. -lmysqlcppconn demo.cpp
42-
./demo
20+
Read full article here https://medium.com/@khanakia/how-to-connect-to-mysql-using-c-in-mac-osx-17e1ada42ccd

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /