本文主要是介绍linux系统命令备忘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ANT
tar -zxvf apache-ant-1.8.1-bin.tar.gz
vi /etc/profile
ANT_HOME=/usr/local/apache-ant-1.8.1
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
export JAVA_HOME JAVA_BIN ANT_HOME PATH CLASSPATH
source /etc/profile
网络
配置ip地址 /etc/sysconfig/network-scripts/ifcfg-eth0
关闭防火墙 service iptables stop
时间
查看时区 cat /etc/sysconfig/clock
重置时区 cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
重置时间 date –s 06/22/11 date –s 15:52:00
将新时间写入CMOS clock –w
java
将JDK加入环境 vi /etc/profile
export JAVA_HOME=/home/jdk1.6.0
export CLASSPATH=/home/jdk1.6.0/jre/lib:$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/bin:$PATH
将环境文件马上起效: 使用source /etc/profile
mysql
设置默认字符集为utf-8
vi /etc/my.cnf
在文件最后加入
default-character-set = utf8
[mysql]default-character-set=utf8
设置mysql随系统启动 chkconfig mysqld on
启动服务 service mysqld start
设置根用户密码(root):mysqladmin –u root password root。
赋予权限给远程用户
grant all on *.* to 'test'@'%' IDENTIFIED BY 'root' with grant option;
grant all on *.* to 'test'@'127.0.0.1' IDENTIFIED BY 'root' with grant option;
grant all on *.* to 'test'@'localhost' IDENTIFIED BY 'root' with grant option;
设置数据库上传文件最大值
set global max_allowed_packet = 16*1024*1024*10
编译源码包
mkdir -p /usr/local/src/mysql
mv mysql-5.1.42.tar.gz /usr/local/src/mysql
cd /usr/local/src/mysql
tar zxvf mysql-5.1.42.tar.gz
cd mysql-5.1.42.tar.gz
./configure --help
CC=gcc CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-assembler --with-big-tables --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=complex
make
make install
cp ./support-files/my-medium.cnf /etc/my.cnf
./scripts/mysql_install_db --user=mysql
chown -R mysql.mysql /usr/local/mysql/var
chmod -R 700 /usr/local/mysql/var
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
service mysqld start
vi /etc/profile
PATH=$PATH:/usr/local/mysql/bin
export PATH
./etc/profile
这篇关于linux系统命令备忘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!