Archive for the ‘MySQL’ Category

How to generate an SQL script from a MySQL database

Tuesday, December 9th, 2008

You can generate an SQL script from a mySQL database by using the mysqldump tool. The mysqldump tool will dump your mySQL database to a file (for example).

How to use DISTINCT on a single column of a multi-column select statement

Saturday, December 6th, 2008

I recently came across this problem today of how to perform a SELECT DISTINCT but on a single column of a multi-column select statement. Imagine a database with a COUNTRIES table. The table contains a list of countries and there is also a "Nationality" column (eg. Australia is the country, ...

MySQL : how to run an SQL script from the command line

Friday, December 5th, 2008

If you have an SQL script file you wish to run from the MySQL command line, you can use the source command at the MySQL command prompt as follows.