#(/usr/local)mkdir java
#(java)wget http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64-rpm.bin
#chmod +x jdk-7-linux-x64-rpm.bin
#./jdk-7-linux-x64-rpm.bin
报错如下:./jdk-6u22-linux-x64-rpm.bin: line 1: html: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 2: head: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 3: title: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 4: META: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 5: link: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 6: link: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 7: $'\r': command not found
./jdk-6u22-linux-x64-rpm.bin: line 8: body: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 9: div: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 10: table: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 11: tr: No such file or directory
./jdk-6u22-linux-x64-rpm.bin: line 12: syntax error near unexpected token `<'
./jdk-6u22-linux-x64-rpm.bin: line 12: ` <td rowspan="2" valign="middle" nowrap>
<a href="http://www.oracle.com"><img src="/errors/us/assets/oralogo-small.gif" width="154" height="19" hspa'e="10" vspace="25" border="0" >
</a></td>
#yum install mysql-server (centos6直接运行)
报错如下:Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
No package mysql-server available.
Error: Nothing to do
#yum search mysql (centos7中的情况)
返回结果如下:Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
====================================== N/S matched: mysql ======================================
MySQL-python.x86_64 : An interface to MySQL
akonadi-mysql.x86_64 : Akonadi MySQL backend support
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
dovecot-mysql.x86_64 : MySQL back end for dovecot
freeradius-mysql.x86_64 : MySQL support for freeradius
libdbi-dbd-mysql.x86_64 : MySQL plugin for libdbi
mysql-connector-java.noarch : Official JDBC driver for MySQL
mysql-connector-odbc.x86_64 : ODBC driver for MySQL
perl-DBD-MySQL.x86_64 : A MySQL interface for Perl
php-mysql.x86_64 : A module for PHP applications that use MySQL databases
php-mysqlnd.x86_64 : A module for PHP applications that use MySQL databases
qt-mysql.i686 : MySQL driver for Qt's SQL classes
qt-mysql.x86_64 : MySQL driver for Qt's SQL classes
qt3-MySQL.i686 : MySQL drivers for Qt 3's SQL classes
qt3-MySQL.x86_64 : MySQL drivers for Qt 3's SQL classes
redland-mysql.x86_64 : MySQL storage support for Redland
rsyslog-mysql.x86_64 : MySQL support for rsyslog
mariadb.x86_64 : A community developed branch of MySQL
mariadb-devel.i686 : Files for development of MariaDB/MySQL applications
mariadb-devel.x86_64 : Files for development of MariaDB/MySQL applications
mariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clients
mariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clients
Name and summary matches only, use "search all" for everything.
查看mysql配置文件/etc/my.cnf
[amy@localhost etc]$ cat my.cnf
## For advice on how to change settings please see
..........
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
8 在MySQL中创建数据库tpcw2
[amy@docker188 ~]$ mysql -uroot -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
......
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
[amy@docker188 servlets]$ javac *.java
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
(当前目录下每个都生成字节码,没报错就行。)
#cp *.class ${CATALINA_HOME}/webapps/servlet/WEB-INF/classes
vi ${CATALINA_HOME}/webapps/servlet/WEB-INF/web.xml
[amy@docker188 args]$ cd ..
[amy@docker188 rbe]$
[amy@docker188 rbe]$ javac *.java
EB.java:317: warning: unreachable catch clause
catch (IOException ioe) {
^
thrown type MalformedURLException has already been caught
Note: RBE.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
14 测试TPC-W:
启动tomcat
[amy@docker188 bin]$ pwd
/usr/local/apache-tomcat-8.0.20/bin
[amy@docker188 bin]$ sudo ./startup.sh
[sudo] password for amy:
Using CATALINA_BASE: /usr/local/apache-tomcat-8.0.20
Using CATALINA_HOME: /usr/local/apache-tomcat-8.0.20
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.0.20/temp
Using JRE_HOME: /
Using CLASSPATH: /usr/local/apache-tomcat-8.0.20/bin/bootstrap.jar:/usr/local/apache-tomcat-8.0.20/bin/tomcat-juli.jar
Tomcat started.
mysqk>GRANT USAGE ON *.* TO 'test'@'%' IDENTIFIED BY 'test' WITH GRANT OPTION;
mysql>grant all privileges on *.* to 'test'@'%' identified by 'test';
mysql>flush privileges;//刷新系统权限表
下面这种方法会报错:
mysql>insert into mysql.user(Host,User,Password) values("%","test",password("test"));会报错!!!
(Mysql添加用户错误:ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value解决方法)