添加Linux用戶
shell> useradd -d /home/skyhawk -m -g root skyhawk
shell> passwd skyhawkmysql
JDK安裝c++
1.下載jdk安裝包解壓。
2.修改用戶家目錄下的.profile文件,在文件尾部添加以下內容:
(其中JAVA_HOME是jdk安裝的路徑)sql
export JAVA_HOME=/home/skyhawk/jdk
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATHshell
Tomcat安裝
1.下載tomcat安裝包,解壓便可。tomcat
MySQL安裝
經過源代碼編譯安裝MySQLserver
1.添加用戶組mysql和用戶mysql
shell> groupadd mysql
shell> useradd -d /home/mysql -m -g mysql mysql
shell> passwd mysqlip
2.安裝依賴包
ncurses-devel bison libaio-devel gcc-c++ (OpenSUSE中使用yast安裝)ci
3.下載源碼包mysql-5.5.34.tar.gz並解壓。進入解壓後的目錄mysql-5.5.34執行以下命令源碼
shell> cmake . -DCMAKE_INSTALL_PREFIX=/home/mysql/mysql -DMYSQL_UNIX_ADDR=/home/mysql/mysql/mysql.sock -DMYSQL_DATADIR=/home/mysql/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=3306
shell> make
shell> make installit
4.繼續配置MySQL
shell> chown -R mysql.mysql /home/mysql/mysql
shell> /home/mysql/mysql/scripts/mysql_install_db --user=mysql --basedir=/home/mysql/mysql --datadir=/home/mysql/mysql/data
shell> cd /home/mysql/mysql/support-files
shell> cp mysql.server /etc/init.d/mysql
shell> cp my-medium.cnf /etc/my.cnf
5.添加mysql開機啓動
shell> chkconfig -add mysql
shell> chkconfig mysql on
#啓動mysql
shell> service mysql start
#修改root用戶密碼
shell> /home/mysql/mysql/bin/mysqladmin -u root password 'culisea'
6.登錄mysql後建立用戶並賦予權限 mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'culisea' WITH GRANT OPTION;