mySql下载与安装
http://museum.php.net/php5/
http://download.softagency.net/MySQL/Downloads/MySQL-5.1/
apt-get autoremove --purge mysql-server-5.0
apt-get autoremove --purge mysql-common
apt-get autoremove --purge mysql-client-5.0
sudo apt-get remove
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
apt-get install mysql-server-5.0 mysql-common mysql-client-5.0
$sudo apt-get remove 软件名
http://www.linuxdiyf.com/viewarticle.php?id=96922
http://hi.baidu.com/17ai2010/blog/item/a88aafc4900ca8c9d10060eb.html
http://forum.ubuntu.org.cn/viewtopic.php?t=227081
http://wenda.tianya.cn/wenda/thread?tid=79f41c7a7e0a7551
http://www.cnblogs.com/hunter007/articles/2251795.html
http://www.xici.net/d59118028.htm
http://dev.mysql.com/downloads/mysql/5.0.html#downloads 下载linux Generic Compressed TAR Archive 版本(直接解压安装就可用)
sudo groupadd mysql
sudo useradd -g mysql mysql
sudo chown -R mysql
sudo chgrp -R mysql
install:/usr/local/mysql/scripts# mysql_install_db --user=mysql
mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
FreeBSD:
/usr/local/bin/mysql_install_db --user=mysql --basedir=/usr/local/ --datadir=/var/db/mysql
sudo chown -R root
sudo chown -R mysql data
start:/usr/local/mysql/bin# mysqld_safe --user=mysql &
modifypassword: mysqladmin -u root password 'rootdjp123456'
login: mysql -u root -p
mysqladmin -u root -p shutdown
修改环境变量$PATH路径:以修改mysql数据库环境变量为例,注:mysql命令路径为/usr/local/mysql/bin/
有三种方式:
1.export命令设置,登出PATH就会恢复
[root@test ~]# export PATH=$PATH:/usr/local/mysql/bin/
注:该目录位于mysql安装目录bin目录
2.修改用户家目录下
#vi ~/.bash_profile
修改PATH行,把/usr/local/mysql/bin添加进去
如:PATH=/usr/local/mysql/bin:$PATH:$HOME/bin
3.修改/etc/profile文件
添加PATH行
PATH=/usr/local/mysql/bin:$PATH