close
Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, 14 November 2011

Testing Techniques - Part 1 - Not Writing Tests

There’s not much doubt about it, the way you test your code is a contentious issue. Different test techniques find favour with different developers for varying reasons including corporate culture, experience and general psychological outlook. For example, you may prefer writing classic unit tests that test an object’s behaviour in isolation by examining return values; you may favour classic stubs, or fake objects; or you may like using mock objects to mock roles, or even using mock objects as stubs. This and my next few blogs takes part of a very, very common design pattern and examines different approaches you could take in testing it.

Monday, 4 July 2011

Installing a MySQL Datasource on Tomcat 7

The default installation of Tomcat doesn’t come with any datasource access, so it’s down to you to set this up and it has to be done manually as there is no wizzo web frontend that’ll do it for you.

The first thing to do is to copy database driver JAR file into the Tomcat lib directory. In my case I’m using the MySQL Community Edition, so I copied mysql-connector-java-5.1.6-bin.jar to Tomcat 7.0\lib.

Monday, 4 April 2011

MySQL JDBC Connection Properties

There are several things to remember when configuring a MySQL JDBC driver connection. Firstly, you need to specify the driver and the driver class is com.mysql.jdbc.Driver located in the mysql-connector-java-5.x.x.jar archive file and available for download from http://dev.mysql.com/downloads/connector/j/.

Tuesday, 1 March 2011

Installing MySQL on Solaris (Part 4 - Initializing the Database)

Once you've installed MySQL, the next step is to create your database and get the whole thing running. To do this:

1. Change the operating user from root to mysql by typing:

Monday, 28 February 2011

Installing MySQL on Solaris (Part 3 - Running the mysql Demon)

Running MySQL as a Demon
This small blog demonstrates the steps required to start-up MySQL as a demon at boot time. The first step is to copy the mysql file from the installation directory (/opt/mysql/mysql/bin)
to the /etc/init.d directory and ensure that it’s executable (chmod 755 mysql).

Sunday, 27 February 2011

Installing MySQL on Solaris (Part 2 - Changing Passwords)

Change the Passwords

Don’t forget to change the passwords for the root and unknown users:

Saturday, 26 February 2011

Installing MySQL on Solaris (Part 1 - Installing the files)

To install MySQL on Solaris, you first need to download it from the MySQL Community Server website.

Before installing MySql, the first job is to create the mysql group by typing: 

groupadd mysql

Next, create the mysql user by typing: 

useradd -g mysql mysql

Sunday, 20 February 2011

Remote Access to MySQL databases

One way in which MySQL differs from other databases such as Oracle, is that by default, only accounts on the same machine as the database are allowed to access the database. This means that, although it’s not heavily documented, all user names consist of two parts: the user and the machine name (or IP address); hence on the local machine, a user called ‘fred’ is really, by default, called ‘fred@localhost’ - although the ‘localhost’ part is usually hidden.