By Rupert
Posts tagged mysql
Debian MySQL
Oct 30th
A default install of mysql on debian would have bind-address set to 127.0.0.1. This is why you can’t accept remote connections to your mysql. In order to establish remote connections to mysql on debian servers, please comment the bind-address as shown below.
42 language = /usr/share/mysql/english 43 skip-external-locking 44 # 45 # Instead of skip-networking the default is now to listen only on 46 # localhost which is more compatible and is not less secure. 47 #bind-address = 127.0.0.1 48 #
Java Thread MySQL Error
May 14th
My java thread bails on me after a few hours. I get the ff errors from my log4j. Anyway, I tried upgrading the mysql-java-connector to mysql-connector-java-5.0.5-bin.jar. And added “autoreconnect=true” in the url string… url=jdbc:mysql://127.0.0.1:3306/cncphs?autoreconnect=true.
1086 java.io.EOFException 1087 1088 STACKTRACE: 1089 1090 java.io.EOFException 1091 at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1895) 1092 at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2342) 1093 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2838) 1094 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1584) 1095 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1675) 1096 at com.mysql.jdbc.Connection.execSQL(Connection.java:2295) 1097 at com.mysql.jdbc.Connection.execSQL(Connection.java:2228) 1098 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1159) 1099 at DBThread.run(DBThread.java:45) 1100
Mapinfo8 MySQL5 Connection
Feb 20th
I only tried this using point objects.
1. Download and install MyODBC3.5.1
2. Create database mapinfotest
3. Create the mapinfo_mapcatalog table as follows:
CREATE TABLE `mapinfo_mapcatalog` (
`SpatialType` float NOT NULL default '0',
`TableName` char(32) NOT NULL default '',
`OwnerName` char(32) NOT NULL default '',
`SpatialColumn` char(32) NOT NULL default '',
`DB_X_LL` float NOT NULL default '0',
`DB_Y_LL` float NOT NULL default '0',
`DB_X_UR` float NOT NULL default '0',
`DB_Y_UR` float NOT NULL default '0',
`CoordinateSystem` char(254) NOT NULL,
`Symbol` char(254) NOT NULL default '',
`XColumnName` char(32) NOT NULL default '',
`YColumnName` char(32) NOT NULL default '',
PRIMARY KEY (`TableName`,`OwnerName`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
4. create a sample table with two (2) decimal columns for the latitude and longitude.
CREATE TABLE `poi_orig2` (
`poiid` decimal(10,0) unsigned NOT NULL default '0',
`id` char(10) NOT NULL default '',
`py_name` char(255) character set utf8 default NULL,
`latitude` decimal(20,8) default '0.00000000',
`longitude` decimal(20,8) default '0.00000000',
PRIMARY KEY (`poiid`,`id`)
)
5. Open Mapinfo 8
6. File -> Open DBMS Connection

7. Table > Maintenance > Make DBMS Table Mappable

Fill up the necessary values for the x,y and the index column.

You need to choose an index column so Mapinfo could update the record/s in MySQL, normally it would be an ID. Once successful you should be able to see the success window…

8. Open the table

Click on the upper right corner to open a dbms connection. After selecting the datasource (mine is system) then it would give you a list of tables to choose from.

Installing myhightman plugin in MySQL
Jan 15th
1. You need a fresh linux machine without mysql installed. You could follow the instructions from
here
2. Download myhightman.tar.gz which I already compiled.
myhightman.tar.gz
Extracting…
-rw-r--r-- 1 root root 377 Jan 12 17:00 bash_profile
drwxr-xr-x 2 1001 wheel 4096 Sep 14 00:30 ft_hightman
-rw-r--r-- 1 1001 wheel 4171 Sep 14 00:25 ft-hightman-M5-0.1.patch
-rw-r--r-- 1 root root 17955 Jan 11 18:52 ft-hightman-M5-0.1.tgz
-rw-r--r-- 1 root root 2051 Jan 12 17:00 install.sh
-rw-r--r-- 1 root root 574 Jan 11 19:19 my.cnf
drwx--x--x 2 root root 4096 Jan 11 19:37 mysql
-rw-r--r-- 1 root root 22265695 Jan 11 18:52 mysql-5.1.11-hi1.tgz
-rw-r--r-- 1 1001 wheel 3450 Sep 14 00:31 README.hightman_parser
-rw-r--r-- 1 root root 0 Jan 11 18:52 stopwords-gbk.txt
-rw-r--r-- 1 root root 3 Jan 11 18:52 stopwords-utf8.txt
-rw-r--r-- 1 root root 1466369 Jan 11 18:52 wordlist-gbk.txt
-rw-r--r-- 1 root root 1907299 Jan 11 18:52 wordlist-utf8.txt
3. install.sh:
#!/bin/sh mysql_install_dir="./mysql-5.1.11-hi1" mysql_base_dir="/usr/local/mysql" hightman_patch="./ft-hightman-M5-0.1.patch" stopword="stopwords-utf8.txt" wordlist="wordlist-utf8.txt" data_dir="/data/mysqldata" temp_dir="/data/temp_dir" echo "removing previous installation" rm -rf $mysql_install_dir echo "unpacking $mysql_install_dir" tar -zxvf $mysql_install_dir.tar.gz echo "copying ft_hightman to $mysql_install_dir/plugin" cp -Rf ft_hightman $mysql_install_dir/plugin/ echo "copying $hightman_patch to $mysql_install_dir" cp $hightman_patch $mysql_install_dir/ echo "patching please answer y to all..." cd $mysql_install_dir patch -p1 < $hightman_patch echo "patching again..." patch -p1 < $hightman_patch echo "processing......." echo "aclocal......." aclocal echo "automake......." automake echo "autoconf......." autoconf echo "configuring..." ./configure --prefix=$mysql_base_dir --with-charset=utf8 --with-extra-charsets=all --with-plugins=fthightman echo "make..." make echo "make install..." make install echo "copying wordlist and stoplist to $mysql_base_dir/share/mysql" cd .. cp -Rf $stopword $mysql_base_dir/share/mysql/ cp -Rf $wordlist $mysql_base_dir/share/mysql/ echo "making mysql datadir on $data_dir" rm -rf $data_dir rm -rf $temp_dir mkdir -p $data_dir mkdir -p $temp_dir echo "copying my.cnf default file to /etc" cp -Rf my.cnf /etc/my.cnf echo "copying custom mysql database to $data_dir" cp -Rf mysql $data_dir echo "changing ownership..." useradd mysql useradd -g mysql mysql chown -Rf mysql:mysql $data_dir chown -Rf mysql:mysql $temp_dir echo "linking myhightman.so..." ln -s /usr/local/mysql/lib/mysql/myhightman.so /usr/lib/myhightman.so echo "creating startup scripts..." cp -rf $mysql_base_dir/share/mysql/mysql.server /etc/init.d/mysql chmod +x /etc/init.d/mysql /sbin/chkconfig --add mysql /sbin/chkconfig --level 345 mysql on /etc/init.d/mysql start echo "YOU HAVE SUCCESSFULLY INSTALLED mysql5 with HIGHTMAN. please add this to your path..." echo "export PATH=$PATH:$mysql_base_dir/bin"
4. CREATE FUNCTION segment RETURNS STRING SONAME ‘myhightman.so’;
5. SET NAMES ‘utf8′;
Comments