MariaDB typically serves as a drop-in replacement for MySQL, so you should still use the mysql database. Sudo g++ -Wall -I/usr/include/cppconn -o testapp tester. Enabling MariaDB will remove MySQL and install MariaDB. Just don't forget to change your host,user,pass,database Or you will get Runtime error. Guides on Official Mysql site is somewhat very confusing and I think some part is wrong. Std::auto_ptr con(driver->connect(url, user, pass)) Last three days are like nightmares to me, I try to install Mysql Connector/C++ on my Ubuntu14.04 server. Then run: dpkg -configure mysql-server-5.5 apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5. Sql::Driver* driver = get_driver_instance() Install phpMyAdmin from the default Ubuntu repositories. Compiling and testing standalone programĬonsider the following example code which only connect to the database. If this complete successfully you should have the connector library installed. 2.Install the Mysql Connector/C++Īs I already say, You can follow the guide on Mysql Official site but some commands on that are wrong, so I finally choose to trust apt-get,so run this in TERMINAL: You can choose to only install mysql, but somehow I feel safer to install all of them. You should already have mysql installed if you read this guide, but in case you don't, Follow a nice guide here. 5 That error means that the package name is not correct, try apt-cache search mysql-server write down the package name you want to install and retry sudo apt-get install correct-package-name Another answer might be that you don't have the correct repository where the package is stored. So I'd like to write this guide to whoever finds it difficult to install it and maybe for my future use in case I mess up my own server!! 1.Installing LAMP stack if you don't already have one. Install the dependencies (this only needs to be done once): Note: These instructions have been tested on Ubuntu 12.04 and Fedora 24, but something similar To install UMS from the tarball on Linux, open a terminal and enter theollowing commands (replace with the version you're installing): Installers for Windows and Mac OS X and tarballs for. Last three days are like nightmares to me, I try to install Mysql Connector/C++ on my Ubuntu14.04 server. Hi everyone, this is my first blog entry and it is about how to connect to Mysql with C++ language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |