JFreeChart? :
- To increase line stoke.
- line 1: XYItemRenderer? render = JFreeChart? _obj.getXYPlot().getRenderer();
- line 2: render.setBaseStroke(new java.awt.BasicStroke(3.0f); // line width=3.0f
MySQL? installation/upgrade on Solaris 10
********************* works with
MySQL? 4 of default package on Solaris 10
******************
/usr/sfw/bin/mysql_install_db
/usr/sfw/bin/mysql_install_db --datadir=/export/home/qliao/mysql
groupadd mysql
useradd -s /bin/false -g mysql -d /export/home/qliao/mysql -c "MySQL User" mysql
chgrp -R mysql /export/home/qliao/mysql
installf SUNWmysqlr /export/home/qliao/mysql d 770 root mysql
scp mysql.xml
root@alastor.cse.nd.edu:/var/svc/manifest/network/
scp svc-mysql
root@alastor.cse.nd.edu:/lib/svc/method/
-- (edit for datadir) DB_DIR=/dsk2/mysql
-- (don't call mysqld_safe, but mysqld directly) /usr/sfw/sbin/mysqld_safe --> /usr/sfw/sbin/mysqld
-- (disable binary log) --binlog-ignore-db=qi_db
chown root:bin /lib/svc/method/svc-mysql chmod 555 /lib/svc/method/svc-mysql chown root:sys /var/svc/manifest/network/mysql.xml
chmod 444 /var/svc/manifest/network/mysql.xml
chown -R mysql:mysql /export/home/qliao/mysql chmod -R 700 /export/home/qliao/mysql
svccfg import /var/svc/manifest/network/mysql.xml
svcadm -v enable mysql
(if make anything, simply svcadm -v disable/enable/restart mysql again)
# a client program that connects to localhost mysql server with the -u user -p passwd -h host and set new password mysqladmin -u root password 'xxxx'
(mysqladmin -u root -h `hostname` password 'xxxx')
# enter monitoring console
mysql -u root -p
create database qi_db;
# By default,
MySQL? only give access to user from 'localhost'
grant all on
. to 'root'@'liaoqn2.cse.nd.edu' identified by 'xxxx';
(grant select on qi_db.* to 'user'@'%' identified by 'xxxx';) // for any host
You can also type any sql command here for "select", "update", etc.
These operations can be done via the
MySQL? GUI client program.
****************** BACKUP -- WORKS
************************
# using mysqldump
mysqldump --user=root --password=xxxx --opt -A > DB_backup_7_2_2007.sql
or
mysqldump --user=root --password=xxxx --opt --quick qi_db | gzip > backup_qi_db.sql.gz
# restore
mysqladmin create qi_db --password=xxxx
gunzip < backup_qi_db.sql.gz | mysql qi_db --password=xxxx
# backup all raw data
# make sure it read from dsk2 and write to dsk1 which might save some time.
# see my backup using GEMS
********************* upgrade using pkg, works on
MySQL? 5.0 on Solaris 10
************************* # see current mysql version bash-3.00# mysql --version mysql Ver 12.22 Distrib 4.0.24, for pc-solaris2.10 (i386)
# see current list of packages
bash-3.00# pkginfo | grep mysql
system SUNWmysqlr mysql -
MySQL? Database Management System (root component)
system SUNWmysqlt mysql -
MySQL? Database Management System (test component)
system SUNWmysqlu mysql -
MySQL? Database Management System (usr component)
# remove old existing packages
pkgrm SUNWmysqlr SUNWmysqlt SUNWmysqlu
# download
MySQL? 5.0
wget
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-solaris10-x86_64.pkg.gz/from/http://mysql.mirrors.hoobly.com/
# decompress the package
gzip -d mysql-5.0.45-solaris10-x86_64.pkg.gz
# create mysql group and user (if not have done so) groupadd mysql useradd -s /bin/false -g mysql -d /export/home/qliao/mysql -c "MySQL User" mysql
# free somespace for the package
# it's ok to delete files in /var/sadm/spool # also make sure the data directory is not full (/opt/mysql might be small)
# add packages (use /opt/mysql as the base directory for mysql) pkgadd -d mysql-5.0.45-solaris10-x86_64.pkg
# see package again
bash-3.00# pkginfo | grep mysql
application mysql
MySQL? Community Server (GPL)
# change the ownership and groupship of mysql directory chgrp -R mysql /opt/mysql chown -R mysql:mysql /opt/mysql
# edit /etc/init.d/mysql to change the default data directory datadir=/export/home/qliao/mysql
# prepare data directory and grand table (remove old one if neccessary) /opt/mysql/mysql/scripts/mysql_install_db --user=mysql --ldata=/export/home/qliao/mysql
# use Service Management Facility in Solaris 10 (instead of traditional /etc/rc?.d way) # create service manifest file /var/svc/manifest/network/mysql.xml
chown root:sys /var/svc/manifest/network/mysql.xml
chmod 444 /var/svc/manifest/network/mysql.xml
# import the service into the service repository svccfg import /var/svc/manifest/network/mysql.xml
# edit /lib/svc/method/svc-mysql (this file will be called to start mysqld)
-- (edit for datadir) DB_DIR=/opt/mysql/mysql/data
-- (don't call mysqld_safe, but mysqld directly) /usr/sfw/sbin/mysqld_safe --> mysqld
change all appearance of mysqld_safe with mysqld, and use /usr/sbin/mysqld because /usr/sfw/sbin/mysqld is removed.
-- (disable binary log) --binlog-ignore-db=qi_db chown root:bin /lib/svc/method/svc-mysql chmod 555 /lib/svc/method/svc-mysql
# start mysql service
svcadm -v enable(/disable/restart) mysql
or
/lib/svc/method/svc-mysql start
reboot
# create root password
mysqladmin -u root password 'xxxx'
# enter monitoring console
mysql -u root -p
# create the database
create database qi_db;
# By default,
MySQL? only give access to user from 'localhost'
grant all on
. to 'root'@'liaoqn2.cse.nd.edu' identified by 'xxxx';
(grant select on qi_db.* to 'user'@'%' identified by 'xxxx';) // for any host
quit
# allow firewall in
edit /etc/ipf/ipf.conf
pass in quick on bge0 from 129.74.0.0/16 to any port = 3306 ipf -f /etc/ipf/ipf.conf
******************* install using tar.gz package
******************** # remove mysql package pkgrm mysql
# get the tar.gz package
wget
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-solaris10-x86_64.tar.gz/from/http://mysql.mirrors.hoobly.com/
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip < /tmp/MySQL-5.0/mysql-5.0.45-solaris10-x86_64.tar.gz | tar xvf - ln -s /usr/local/mysql-5.0.45-solaris10-x86_64 mysql cd mysql chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
reboot
bin/mysqld_safe --user=mysql &
*************************************************************************