系统检测 : sudo apt-get update
1、配置信息
Ubuntu 系统 64位 mysql 5.5 jdk1.7 tomcat6
2、配置JDK
sudo mkdir /usr/lib/jvm
sudo tar zxvf jdk-tar.gz -C /usr/lib/jvm
cd /usr/lib/jvm
sudo mv jdk1.7.0_21 java
vim ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/bin/javac 300
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java/bin/jar 300
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java/bin/javah 300
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java/bin/javap 300
:wq和:x是存盘退出
选择jdk
sudo update-alternatives --config java
tomcat启动的时候
Permission denied解决方法
chmod u+x *.sh
show variables like 'character%';
sudo vi /etc/resolv.conf
sudo source /etc/resolv.conf
resolvonf -u
3、linux安装mysql
sudo apt-get install mysql-server
mysql -u root -p
创建用户
create user 'frank'@'localhost';
set password for 'frank'@'localhost' = password('abcdefg');
create database sampledb;
配置用户权限
grant all privileges on sampledb.* to 'frank'@'localhost';
source 文件
导出数据:mysqldump -hlocalhost -u user -p password >XX.sql
链接数据库:mysql -h localhost - u root
mysql中文乱码解决
这里简单明了地说下:
对于mysql5.5版本,需要在/etc/mysql/my.cnf做如下修改:
[client]下添加:default-character-set = utf8
[mysqld]下添加:character-set-server = utf8
对于mysql5.5之前的版本,做如下修改:
在[client] 和 [mysqld]下都添加一行
default-character-set = utf8
如果在mysql5.5 版本中也这么配置会导致mysql服务起不来。