Monday, August 22, 2011

Reverse engineer MySQL Database on Linux to Windows Visio

Reverse engineering a database can be fun, especially when someone needs it in Microsoft and you're working on Linux. MySQL generates tools that will reverse engineer databases with their workbench product, but there are lots of people who like documenting in Microsoft, so here's how to connect your Windows system to a Linux MySQL database.

1. Make sure, or install the following packages on your Linux MySQL server;
- mysql-connector-odbc
- unixODBC

yum -y install mysql-connector-odbc unixODBC

2. Edit the file /etc/odbcinit.ini
This file should be OK from the point of install pointing to the correct shared objects;
e.g.
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1

3. Edit the /etc/odbc.ini will need to have information to connect to your database, replace italics with your details;
[nameOfDB]
driver = MySQL
Database = yourDBName
Server = localhost
Socket = /var/lib/mysql/mysql.sock
User = yourDBconnectUser
Password = youDBconnectPassword

4. Edit the /etc/my.cnf file and add the bind-address of your external IP;
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
bind-address=yourServerIP

5. Now we need to give access to your database user specified as yourDBconnectUser in step 3;
- Log in to the mysql database
- GRANT ALL on yourDatabase.* to yourDBconnectUser@'yourServerIP' IDENTIFIED BY 'youDBconnectPassword';

6. Now configure your Windows system ODBC MySQL connector to point to this database;
- This requires you to download the MySQL ODBC Connector from MySQL
- You will need to use the IP Address, Username, Password and Database configured above to connect to the Database.

Sunday, August 7, 2011

HP DV3-4300SA

Well, that time of the century came that required a new laptop to be purchased, and given that I'm into small laptops with lots of power, I decided that this time I would go for a 13.3 instead of the 12.1 since the market for 12.1 sized screens was a little lame this year, whilst the 13.3 had some nice powered systems to offer. As a side point I'm annoyed that ACER in America produce an i7 10.1in screen and not in the UK (bastards).
Anyhow, it came down to either an ASUS (with no DVD and less hard disk) or the HP DV3-4300SA, which looks like a nice system, has the right specs, but ......

1. They lie as do all manufacturers about battery life. These days anything claiming to last for 5 - 6 hours means that you'll get 1.5 hours out of the battery. Now do you think I should challenge HP on this? Even if I just turned it on and left it without doing anything I'd be lucky to get 2 hours out of the battery. Come on people, put the right number of real hours down.

2. The screen. A nice clear crisp screen, obviously only made for Windows. Fedora 14 currently has some annoying issues with this laptop, so will venture (unfortunately) to Fedora 15 to see if it resolves the problem, the downside is the god awful desktop that they've forced on everyone, so may have to resort to XFCE in future if Gnome don't go back to a decent one. The problem with the screen is that it goes blank (although I know this is being worked on in the Linux community and that's why I think they've hopefully cracked it with FC15). This is during boot up, so you have to shut the lid and open it before the OS really gets going, otherwise it starts to throw a hissy fit. And there's more. Whilst using the operating system, I've had to disable the suspend option just in case the screen decides to do it's own thing.

3. Power supply. Get this, whilst using Linux if you plug in the power supply after running on battery for an hour (don't want it to start suspending now) it throws another hissy fit to the point that it logs you out and then doesn't let you log back in or get to a command line. So the only option is the power button. It's a good job FC14 has some good disk management and file systems that are resilient.

4. The touchpad is bloody annoying to. Why couldn't they just put 2 click zones on the pad. Oh, sorry they have, but didn't need to as there isn't 2. There's only one click, even though the separated the mouse pad to look like there are 2 buttons. Instead you have to do some sort of magical salute on the mouse pad to perform what would normally be a right click. HP just take away the dividing marks on the touchpad, you are not fooling anyone, and they just get in the way if you don't make a right click.

Come on HP you should know better as you are a company that provides Linux to businesses, you should realise that people will be using your laptops as well for this stuff. Not all of us are Windows fans, and some of us think that the Mac is not a real computer either.

Current verdict is don't by the HP DV3-4300SA if you are planning on running Fedora 14. I'll let you know about FC15 soon, much to my disgust in both camps.