linuxs下的jdk+tomcat+mysql配置具体步骤

Xshell:\>
Connecting to 192.168.43.128:22...
Connection established.
Escape character is ‘^@]‘.

/usr/bin/xauth:  creating new authority file /root/.Xauthority
[[email protected] ~]# ipconfig
-bash: ipconfig: command not found
[[email protected] ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:95:88:4E  
          inet addr:192.168.43.128  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe95:884e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13338 (13.0 KiB)  TX bytes:9373 (9.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

[[email protected] ~]# ls
anaconda-ks.cfg  install.log  install.log.syslog
[[email protected] ~]# cd /usr/local/tmp
[[email protected] tmp]# ls
jdk-7u80-linux-x64.tar.gz
[[email protected] tmp]# tar zxf jdk-7u80-linux-x64.tar.gz
[[email protected] tmp]# ls
jdk1.7.0_80  jdk-7u80-linux-x64.tar.gz
[[email protected] tmp]# cp -r jdk1.7.0_80 /usr/local/jdk7
[[email protected] tmp]# cd ..
[[email protected] local]# ls
bin  etc  games  include  jdk7  lib  lib64  libexec  sbin  share  src  tmp
[[email protected] local]# vim /etc/profile
[[email protected] local]# source /etc/profile
[[email protected] local]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[[email protected] local]# vim /etc/profile
[[email protected] local]# source /etc/profile
[[email protected] local]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[[email protected] local]# cd tmp
[[email protected] tmp]# vim demo.java
[[email protected] tmp]# javac demo.java
demo.java:3: error: package system does not exist
system.out.println("hello world");
      ^
1 error
[[email protected] tmp]# vim demo.java
[[email protected] tmp]# javac demo.java
[[email protected] tmp]# java demo
hello world
[[email protected] tmp]# ls
apache-tomcat-7.0.68.tar.gz  demo.class  demo.java  jdk1.7.0_80  jdk-7u80-linux-x64.tar.gz  mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
[[email protected] tmp]# tar zxf apache-tomcat-7.0.68.tar.gz
[[email protected] tmp]# ls
apache-tomcat-7.0.68  apache-tomcat-7.0.68.tar.gz  demo.class  demo.java  jdk1.7.0_80  jdk-7u80-linux-x64.tar.gz  mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
[[email protected] tmp]# cp -r apache-tomcat-7.0.68 ../tomcat
[[email protected] tmp]# cd ..
[[email protected] local]# ls
bin  etc  games  include  jdk7  lib  lib64  libexec  sbin  share  src  tmp  tomcat
[[email protected] local]# cd /etc/profile
-bash: cd: /etc/profile: Not a directory
[[email protected] local]# vim /etc/profile
[[email protected] local]# source /etc/profile
[[email protected] local]# cd tomcat
[[email protected] tomcat]# cd bin
[[email protected] bin]# ls
bootstrap.jar  catalina.sh         commons-daemon.jar            configtest.bat  daemon.sh   digest.sh         setclasspath.sh  shutdown.sh  startup.sh       tomcat-native.tar.gz  tool-wrapper.sh  version.sh
catalina.bat   catalina-tasks.xml  commons-daemon-native.tar.gz  configtest.sh   digest.bat  setclasspath.bat  shutdown.bat     startup.bat  tomcat-juli.jar  tool-wrapper.bat      version.bat
[[email protected] bin]# ./startup.sh
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk7
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[[email protected] bin]# vim /etc/sysconfig/iptables
[[email protected] bin]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[[email protected] bin]# ls
bootstrap.jar  catalina.sh         commons-daemon.jar            configtest.bat  daemon.sh   digest.sh         setclasspath.sh  shutdown.sh  startup.sh       tomcat-native.tar.gz  tool-wrapper.sh  version.sh
catalina.bat   catalina-tasks.xml  commons-daemon-native.tar.gz  configtest.sh   digest.bat  setclasspath.bat  shutdown.bat     startup.bat  tomcat-juli.jar  tool-wrapper.bat      version.bat
You have mail in /var/spool/mail/root
[[email protected] bin]# ./shutdown.sh
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk7
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[[email protected] bin]# ./startup.sh & tailf /usr/local/tomcat/logs/catalina.out
[1] 35423
Jun 26, 2019 12:48:23 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jun 26, 2019 12:48:23 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jun 26, 2019 12:48:23 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2019 12:48:23 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jun 26, 2019 12:48:23 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk7
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
Jun 26, 2019 12:49:25 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.68
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Feb 8 2016 20:25:54 UTC
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.68.0
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            2.6.32-431.el6.x86_64
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             /usr/local/jdk7/jre
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_80-b15
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /usr/local/tomcat
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /usr/local/tomcat
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/usr/local/tomcat/endorsed
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/usr/local/tomcat
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/usr/local/tomcat
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
Jun 26, 2019 12:49:26 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Jun 26, 2019 12:49:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 26, 2019 12:49:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1723 ms
Jun 26, 2019 12:49:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 26, 2019 12:49:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68
Jun 26, 2019 12:49:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/manager
Jun 26, 2019 12:49:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/manager has finished in 1,331 ms
Jun 26, 2019 12:49:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/examples
Jun 26, 2019 12:49:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/examples has finished in 824 ms
Jun 26, 2019 12:49:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/host-manager
Jun 26, 2019 12:49:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/host-manager has finished in 156 ms
Jun 26, 2019 12:49:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/docs
Jun 26, 2019 12:49:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/docs has finished in 108 ms
Jun 26, 2019 12:49:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat/webapps/ROOT
Jun 26, 2019 12:49:29 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat/webapps/ROOT has finished in 137 ms
Jun 26, 2019 12:49:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 26, 2019 12:49:29 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2019 12:49:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2768 ms
^C
[1]+  Done                    ./startup.sh
[[email protected] bin]# cd /usr/local/tmp
[[email protected] tmp]# ls
apache-tomcat-7.0.68  apache-tomcat-7.0.68.tar.gz  demo.class  demo.java  jdk1.7.0_80  jdk-7u80-linux-x64.tar.gz  mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
[[email protected] tmp]# tar zxf mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
[[email protected] tmp]# ls
apache-tomcat-7.0.68  apache-tomcat-7.0.68.tar.gz  demo.class  demo.java  jdk1.7.0_80  jdk-7u80-linux-x64.tar.gz  mysql-5.6.31-linux-glibc2.5-x86_64  mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
[[email protected] tmp]# cp -r mysql-5.6.31-linux-glibc2.5-x86_64 ../mysql
[[email protected] tmp]# groupadd mysql
[[email protected] tmp]# useradd -r -g mysql mysql
[[email protected] tmp]# cd ..
[[email protected] local]# cd mysql
[[email protected] mysql]# chgrp -R mysql .
[[email protected] mysql]# chown -R mysql .
[[email protected] mysql]# ls /etc/my.cnf
/etc/my.cnf
[[email protected] mysql]# rm /etc/my.cnf
rm: remove regular file `/etc/my.cnf‘? y
[[email protected] mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...2019-06-26 13:08:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-06-26 13:08:11 0 [Note] ./bin/mysqld (mysqld 5.6.31) starting as process 35505 ...
2019-06-26 13:08:11 35505 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-06-26 13:08:11 35505 [Note] InnoDB: The InnoDB memory heap is disabled
2019-06-26 13:08:11 35505 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-26 13:08:11 35505 [Note] InnoDB: Memory barrier is not used
2019-06-26 13:08:11 35505 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-06-26 13:08:11 35505 [Note] InnoDB: Using Linux native AIO
2019-06-26 13:08:11 35505 [Note] InnoDB: Using CPU crc32 instructions
2019-06-26 13:08:11 35505 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-06-26 13:08:11 35505 [Note] InnoDB: Completed initialization of buffer pool
2019-06-26 13:08:11 35505 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2019-06-26 13:08:11 35505 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2019-06-26 13:08:11 35505 [Note] InnoDB: Database physically writes the file full: wait...
2019-06-26 13:08:11 35505 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2019-06-26 13:08:11 35505 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2019-06-26 13:08:11 35505 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-06-26 13:08:11 35505 [Warning] InnoDB: New log files created, LSN=45781
2019-06-26 13:08:11 35505 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-06-26 13:08:11 35505 [Note] InnoDB: Doublewrite buffer created
2019-06-26 13:08:11 35505 [Note] InnoDB: 128 rollback segment(s) are active.
2019-06-26 13:08:11 35505 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-06-26 13:08:11 35505 [Note] InnoDB: Foreign key constraint system tables created
2019-06-26 13:08:11 35505 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-06-26 13:08:11 35505 [Note] InnoDB: Tablespace and datafile system tables created.
2019-06-26 13:08:11 35505 [Note] InnoDB: Waiting for purge to start
2019-06-26 13:08:11 35505 [Note] InnoDB: 5.6.31 started; log sequence number 0
2019-06-26 13:08:12 35505 [Note] Binlog end
2019-06-26 13:08:12 35505 [Note] InnoDB: FTS optimize thread exiting.
2019-06-26 13:08:12 35505 [Note] InnoDB: Starting shutdown...
2019-06-26 13:08:13 35505 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2019-06-26 13:08:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-06-26 13:08:13 0 [Note] ./bin/mysqld (mysqld 5.6.31) starting as process 35527 ...
2019-06-26 13:08:13 35527 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-06-26 13:08:13 35527 [Note] InnoDB: The InnoDB memory heap is disabled
2019-06-26 13:08:13 35527 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-06-26 13:08:13 35527 [Note] InnoDB: Memory barrier is not used
2019-06-26 13:08:13 35527 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-06-26 13:08:13 35527 [Note] InnoDB: Using Linux native AIO
2019-06-26 13:08:13 35527 [Note] InnoDB: Using CPU crc32 instructions
2019-06-26 13:08:13 35527 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-06-26 13:08:13 35527 [Note] InnoDB: Completed initialization of buffer pool
2019-06-26 13:08:13 35527 [Note] InnoDB: Highest supported file format is Barracuda.
2019-06-26 13:08:13 35527 [Note] InnoDB: 128 rollback segment(s) are active.
2019-06-26 13:08:13 35527 [Note] InnoDB: Waiting for purge to start
2019-06-26 13:08:13 35527 [Note] InnoDB: 5.6.31 started; log sequence number 1625977
2019-06-26 13:08:13 35527 [Note] Binlog end
2019-06-26 13:08:13 35527 [Note] InnoDB: FTS optimize thread exiting.
2019-06-26 13:08:13 35527 [Note] InnoDB: Starting shutdown...
2019-06-26 13:08:15 35527 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password ‘new-password‘
  ./bin/mysqladmin -u root -h localhost.localdomain password ‘new-password‘

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

[[email protected] mysql]# cp support-files/my-default.cnf /etc/my.cnf
[[email protected] mysql]# cp support-files/my-default.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf‘? n
[[email protected] mysql]# cp support-files/mysql.server      /etc/rc.d/init.d/mysql
[[email protected] mysql]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
[[email protected] mysql]# service mysql start
Starting MySQL.. SUCCESS!
[[email protected] mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
[[email protected] mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show datebases
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘datebases‘ at line 1
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye
[[email protected] mysql]# vim /etc/my.cnf
[[email protected] mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password= passworD ("smallming") where user=‘root‘;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> update user set password=passworD("root")where user=‘root‘;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> mysql -u root -p
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘mysql -u root -p‘ at line 1
mysql> Ctrl-C -- exit!
Aborted
[[email protected] mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> Ctrl-C -- exit!
Aborted
[[email protected] mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
[[email protected] mysql]# no
-bash: no: command not found
[[email protected] mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
[[email protected] mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select user,host from user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | 127.0.0.1             |
| root | ::1                   |
|      | localhost             |
| root | localhost             |
|      | localhost.localdomain |
| root | localhost.localdomain |
+------+-----------------------+
6 rows in set (0.00 sec)

mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by "root" with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host from user;
+------+-----------------------+
| user | host                  |
+------+-----------------------+
| root | %                     |
| root | 127.0.0.1             |
| root | ::1                   |
|      | localhost             |
| root | localhost             |
|      | localhost.localdomain |
| root | localhost.localdomain |
+------+-----------------------+
7 rows in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> Ctrl-C -- exit!
Aborted
[[email protected] mysql]# vim /etc/sysconfig/iptables
[[email protected] mysql]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[[email protected] mysql]#vim /etc/profile

在linuxs中如果要批量添加数据可以:

如果忘记了root密码:

即可不使用密码重新进入。

使用客户端工具xshell连接linuxs编写代码更为方便。

使用FileZilla-3.42.1工具进行windows和linuxs的文件传输

可能存在连不上的情况,可能是因为防火墙的拦截,在linuxs中使用service iptables stop

也可能是linuxs下未开启ssh服务,使用service sshd start

资料链结:压缩包比较大,你可以去官网下载,也可以私我(2967254652),我分享给你。

原文地址:https://www.cnblogs.com/aasu/p/11094095.html

时间: 2024-10-25 23:32:38

linuxs下的jdk+tomcat+mysql配置具体步骤的相关文章

linux 下安装 jdk tomcat 并配置

linux下安装TOMCAT与JDK 第1步:新建boss用户,用户名:boss,密码:boss 第2步:将安装用户路径设置成/app/boss [[email protected]]# useradd-d /app/boss -m boss [[email protected]]# passwdboss Changing password for user boss. New password:  boss passwd: all authentication tokens updated s

JDK TOMCAT MYSQL 配置

Java 开发环境 环境和版本介绍: 系统环境: CentOS-7-x86_64- 1810 软件本版 J d k  版本   jdk-8u181-linux-x64 Tomcat 版本   apache-tomcat-8.5.20 Mysql  版本   mysql5.7.16 一.JDK安装三种方式 1.方法一:利用yum源来安装jdk(此方法不需要配置环境变量) (1)查看yum库中的java安装包 : yum -y list java* (2)安装需要的jdk版本的所有java程序: y

测试环境搭建和部署(在Linux环境下搭建jdk+Tomcat+mysql环境和项目包的部署)

1.Linux环境(我搭建的是64位centos版本的linux系统) 1.下载并安装一个VMware Workstation虚拟机,是搭建Linux系统的平台.      2.下载一个centos安装包. 3.打开VMware Workstation,新建一个虚拟机,根据提示安装步骤,导入安装包,设置用户名和密码(此处设置的是普通账户,但密码和根账号root共用),其他的步骤全部点击下一步到最后,然后 静静等安装成功. 4.安装完成后,输入密码进入图形化界面,点击右键选择Open in Ter

linux 下 jdk+tomcat+mysql 的 jsp 环境搭建

JDK 在 linux 下安装 1.          把安装文件放在 /opt 下,并执行 [[email protected] opt]# ./jdk-1_5_0_06-linux-i586.bin 并输入 yes 确认安装 2.         创建 /etc/profile.d/java.sh 编辑环境变量 export JAVA_HOME=/opt/jdk export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH export CLASSP

web项目打包成exe在windows下一键安装 jdk+Tomcat+mysql

最近因为公司销售人员不懂软件,所以每次部署项目都需要技术人员到客户现场进行部署,很不方便.所以公司就让把我们的项目做成傻瓜式安装,这样就可以让销售人员去安装,也给技术省了很多事.我在网上找了很多教程但是有些地方还是不全,而且每个人写的也都不一样,所以在制作过程中遇到很多问题,经过几天研究终于实现了,现在就把我整理.研究的写下来,希望可以帮到更多人. 一:打包工具 在网上下载一个 Inno steup的制作exe文件工具 下面是我整理好的compile.iss文件(以下这个可以直接复制过去把要改的

LInux环境下Eclipse + Tomcat + MySQL 配置J2EE开发环境的方法

上一篇博文里总结了面向对象三大特性在Java中的体现,现在谈一谈Java中的抽象类,接口,内部类等特性. 一. 抽象类 public abstract class Shape { public int shapeID = 0; public abstract double getArea(); } Java中允许类.接口或成员方法具有抽象属性,而不允许成员域或构造方法具有抽象属性. 类修饰词中含有abstract的类具有抽象属性,称为抽象类:接口总是具有抽象属性. 如果成员方法的修饰词中含有ab

Linux(ubuntu/centos) 部署Java项目 外加安装jdk+tomcat+Mysql

这是我第一次写博文,我希望我写的文本能够帮助到大家,这能让我感到很满足! 本次分享的文章 主要解决 Linux下(ubuntu+centos) 部署Java项目 当然也包括安装jdk+tomcat+mysql 准备环境: 系统环境:

jdk+tomcat+mysql搭建网站无法打开

我们webwall的测试网站凌云论坛,是我之前用jdk-6u5-windows-i586-p.exe+apachetomcat6+mysql-essential-5.1.40-win32.msi搭建的,安装过程中都是使用了默认安装地址.现在网站出现了问题,无法打开. 查看tomcat日志: C:\Program Files\Apache SoftwareFoundation\Tomcat 6.0\logs: LifecycleException:  No UserDatabase compone

Cent OS服务器配置(JDK+Tomcat+MySQL)

本文摘自:Cent OS服务器配置(JDK+Tomcat+MySQL) 学习tar解压 解压 tar 文件 tar -zxvf apache-tomcat-6.0.35.tar.gz tomcat   [mysql] 3 检查目前的数据库编码情况 show variables like "%char%";  4 将数据库的编码修改为utf8 mysql>set names utf8; 6 编辑MySQL的配置文件 vim /etc/my.cnf  加一句 default-char