Project to deploy pit encountered on Linux

Author: Bells c
personal micro-channel public number: program ape fight with

1. Local Navicat for MySQL can not connect to the server (Centos 7 x86_64 bbr)

Error 1045:

image

Solving steps:

1. Check whether the user name and password error

2. case correct username and password, enter telnet server mysql,

mysql> use mysql;
Database changed
mysql> grant all privileges  on *.* to root@'%' identified by "password";
Query OK, 0 rows affected (0.00 sec)

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

mysql> select host,user,password from user;
+--------------+------+-------------------------------------------+
| host         | user | password                                  |
+--------------+------+-------------------------------------------+
| localhost    | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
| 192.168.1.1 | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
| %            | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
+--------------+------+-------------------------------------------+
3 rows in set (0.00 sec)

grant all privileges on *.* to root@'%' identified by "password";

Above this sentence, it means that all the ip access to MySql on the machine with the user name root password for password. Of course, you can customize the password.

Above, basically solved the problem (I was so resolved, if you have not solved it and then google it)

2. deployed to the server (Centos 7 x86_64 bbr) submit garbled form

The problem is simply disgusting .... because the local development environment is tomcat7 development, my server is tomcat8, online search a lot ... what 7 -> 8 To change the configuration are encoded in service.xml ... useless, ready to give up ... thought it was coded reason foreign server ... and then ... suddenly remembered, URL back may be a problem when jdbc connection to the database

original

<property name="user">root</property>
<property name="password">root</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://ip地址:3306/class3</property>

jsbcUrl add parameters?characterEncoding=UTF-8

After the change:

<property name="user">root</property>
<property name="password">root</property>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://ip地址:3306/class3?characterEncoding=UTF-8</property>

Above, resolve

emm, filled pit +2

good night

Guess you like

Origin www.cnblogs.com/jsccc520/p/11669377.html
Recommended