Archive for June, 2010

common used mysql commands

June 13th, 2010

start up & shut down mysql:

sudo /etc/init.d/mysql start;
sudo /etc/init.d/mysql stop;

or
sudo mysqladmin shutdown -p;

show db & tables:

show databases;
show tables;
desc tableName;

show the defination of a table:

show create table tableName;

show server status

SHOW FULL PROCESSLIST;
show status like ‘Conn%’;
show status like ‘%onn%’;
$ mysqladmin status

SHOW TABLE STATUS;

profile a query

EXPLAIN SELECT * FROM tableName;
or
SET profiling=1;
SELECT * FROM tableName;
...
SET profiling=0;
SHOW profiles;
SHOW profile for query 1;

Add a user

CREATE USER ‘nb’@'localhost’ IDENTIFIED BY ‘yourpassword’;
GRANT SELECT, INSERT, UPDATE, DELETE ON somedb.* TO ‘nb’@'localhost’;

show warnings

SHOW WARNINGS [LIMIT [offset,] row_count]
SHOW COUNT(*) WARNINGS

see: http://dev.mysql.com/doc/refman/5.5/en/show-warnings.html

Compress the result from mysqldump

Compress directly with gzip
mysqldump < mysqldump options> | gzip > outputfile.sql.gz

Gunzip and import using gzip
gunzip < outputfile.sql.gz | mysql < mysql options>

Compress directly with bzip2
mysqldump < mysqldump options> | bzip2 > outputfile.sql.bz2

Bunzip2 and import using bzip2
bunzip2 < outputfile.sql.bz2 | mysql < mysql options>

Compress directly with lzma
mysqldump < mysqldump options> | lzma > outputfile.sql.lzma

Unlzma and import using unlzma
unlzma < outputfile.sql.lzma | mysql < mysql options>

NOTE:

mysqldump < mysqldump options

can be replaced with:

mysqldump -hYourHost -uYourUserName -pYourPassword

reference: http://mediakey.dk/~cc/compressing-mysqldump-output-mysql-gzip-bzip2-and-lzma-7z/

even more…

please wait...

install sopcast player in Ubuntu 10.04(Lucid Lynx) AMD64

June 12th, 2010

If you are installing sopcast player on a X86 machine, you can read this article:

http://www.ubuntugeek.com/how-to-install-sopcast-player-in-ubuntu-9-10karmic.html.

But if you want to install sopcast on a AMD64 machine, you need to manually install sp-auth as said in here:

http://tinformix.blogspot.com/2009/05/how-to-sopcast-on-gentoo-amd64.html.

In summary (for AMD64):

  • add the sopcast player PPA:
    sudo add-apt-repository ppa:jason-scheunemann/ppa
  • update the source list:
    sudo apt-get update
  • install sp-auth:
    wget http://download.easetuner.com/download/sp-auth.tgz
    tar xzf sp-auth.tgz
    sudo mv sp-auth /usr/local/share
    sudo ln -s /usr/local/share/sp-auth/sp-sc-auth /usr/local/bin/sp-sc
  • install spcast-player:
    sudo apt-get install sopcast-player

安装显卡驱动时提示无法复制文件nv4_mini.sy_

June 11th, 2010

今天在安装acer 4520G中NGForce 8400显卡驱动时,老师提示“无法复制文件nv4_mini.sy_“这个错误,刚开始还以为下载的版本错了,于是在别的地方找了号几个版本。都不行,总是提示这个错误。在网上看了,也没有什么解决方案。有一个答案居然说拿到售后那换了主板才搞定,吓我一跳。

不过后来,我在文件夹下仔细查看,发现nv4_mini.sy_这个文件是确确实实存在的。于是联想到windows(至少xp)下这个臭名昭著的文件夹空格问题(不过说实话其实也不能怪xp,其实程序里面稍作处理也就没事)。而我正好是把文件夹放在桌面,而桌面是在“Documents and Settings/XXX”里面,正好有空格。于是把驱动的安装文件夹拷贝到C盘根目录下,再安装。乖乖!果然一切OK!!!日!浪费了我整整1个上午啊。本来机器就不怎么灵光了,还害我整来整去,郁闷煞也!