Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Install MySQL connector/C++ on Ubuntu 11.04

Here is what I did to install MySQL and connector/C++.
First install MySQL Server.

Then download MySQL connector/C++ from here.
I used the binary file.

Setup MySql on Ubuntu 11.04

Install MySQL
sudo apt-get install mysql-server-5.1
sudo mysql_install_db
sudo mysql_secure_installation
Then download and install JDBC (connector/J) driver.

MySQL Programming in Java

Connecting to Database:
String url = "jdbc:mysql://hostname:portNumber/databaseName";
String username = "dbuser";
String password = "secret";
Connection conn = DriverManager.getConnection(url, 
   username, password);

Setup MySQL on Fedora 15

yum install mysql-server
Start MySQL server and autostart on boot:
/etc/init.d/mysqld start  ## use restart after update
##OR##
service mysqld start ## use restart after update
chkconfig --levels 235 mysqld on