Open source software security

Setting up a Linux MySQL server for Windows clients

30 November -0001
December 3, 2003
by: Justin Keane

Note that these are just my quick install notes so they're not real pretty

Step 1 - install the MySQL server and fix the root password
Step 2 - update the tables in the 'mysql' database to allow remote users to connect, use the following:

insert into host (host, Db, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Alter_priv) values ('192.168.0.1', 'dbName', 'y', 'y', 'y', 'y', 'y', 'y', 'y');


insert into db (host,db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,Referen
ces_priv,Index_priv,Alter_priv,Create_tmp_table_priv,Lock_tables_priv) values ('192.168.0.1','dbName','root','y','y','y','y','y','y','y','y','y','y','y','y');

insert into user (host, user, password) values ('192.168.0.1', 'root', PASSWORD('theNewPassword')); 

flush privileges; 

Note that this is a small MySQL database so I'm giving everyone root access.

Next you need to download and install SQuirreL SQL client so that everyone can have access. This is easiest if you've got the Java SDK already installed. Download the .jar installer from SourceForge.net and install it using 'java -jar installerName.jar' at the command line (will spawn a GUI for you).

Next you need to install the correct MySQL driver for SQuirreL so you can connect. You can download a good one from MySQL.com named: mysql-connector-java-3.0.9-stable-bin.jar. Put this somewhere you can find it (usually C:\Program Files\SQuirreL\libs) and then update the driver in SQuirreL (edit it, click the 'Extra Class Path' tab and click 'Add' then browse for the .jar). At this point you should be able to set up a new alias using the driver and connect to the database (make sure there aren't any firewall restrictions on port 3306 and also make sure to alter the default connection settings for the driver (they're 3360)). When creating the alias you have to change the name from the default to one without any square brackets or less than or greater than symbols, for example:

jdbc:mysql://servername.domain.com:3306/dbName

Test the connection and you should be good to go.