jpress连接不上mysql_linux服务器配置jpress以及出现的问题记录

本文详细记录了在Linux环境下配置JPress与MySQL8.0的过程,包括创建数据库用户、分配所有权限以及解决连接问题。针对可能出现的错误,如JPress安装失败、MySQL授权问题和Navicat连接问题,提供了解决方案,如更改JPress版本、修改my.cnf文件以指定socket路径,并给出了MySQL和JDK的版本信息。
摘要由CSDN通过智能技术生成

mysql> use jpress;

Database changed

mysql> create user 'jpress'@'%' identified by 'Root123.';

Query OK, 0 rows affected (0.06 sec)

mysql> grant all privileges on *.* to 'jpress'@'%' with grant option;

Query OK, 0 rows affected (0.02 sec)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> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root123.';

Query OK, 0 rows affected (0.01 sec)

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| jpress |

| mysql |

| performance_schema |

| sys |

+--------------------+

5 rows in set (0.01 sec)

mysql> select user,host from mysql.user;

+------------------+-----------+

| user | host |

+------------------+-----------+

| jpress | % |

| root | % |

| jpress | localhost |

| mysql.infoschema | localhost |

| mysql.session | localhost |

| mysql.sys | localhost |

| root | localhost |

+------------------+-----------+

7 rows in set (0.00 sec)mysql> grant all privileges on *.* to 'jpress'@'%' with grant option;

Query OK, 0 rows affected (0.02 sec)

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.00 sec)

mysql> exit

[root@bogon bin]# ./version.sh

Using CATALINA_BASE: /usr/local/workspace/apache-tomcat-8.5.58

Using CATALINA_HOME: /usr/local/workspace/apache-tomcat-8.5.58

Using CATALINA_TMPDIR: /usr/local/workspace/apache-tomcat-8.5.58/temp

Using JRE_HOME: /usr/local/workspace/jdk1.8.0_261

Using CLASSPATH: /usr/local/workspace/apache-tomcat-8.5.58/bin/bootstrap.jar:/usr/local/workspace/apache-tomcat-8.5.58/bin/tomcat-juli.jar

Using CATALINA_OPTS:

Server version: Apache Tomcat/8.5.58

Server built: Sep 10 2020 21:45:33 UTC

Server number: 8.5.58.0

OS Name: Linux

OS Version: 3.10.0-693.el7.x86_64

Architecture: amd64

JVM Version: 1.8.0_261-b12

JVM Vendor: Oracle Corporation

配置jpress,需要war包,本文用的jpress-v3.2.4.war,

v3.2.4war包在网盘中 链接:https://pan.baidu.com/s/1toHMzutkkQQp3ULMsIVuxg   提取码:0ej2

其他版本mysql8.0 、jdk1.8

出现过的问题:

1、jpress安装失败----提示连接数据库失败   eq:  更换jpress版本为v3.2.4

2、mysql授权问题----上面代码中已经写明具体,

3、mysql ------Can't connect to local MySQL server through socket '/storage/db/mysql/mysql.sock

eq:  修改my.cnf文件:

在/etc/my.cnf文件中添加如下内容,并重启mysqls服务,即可解决mysql,mysqldump,mysqladmin的“Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'”问题:注意socket对应的是你本地存放mysql.sock地址,找不到就用 find name 'mysql.sock'查

[mysqld]

datadir=/storage/db/mysql

socket=/storage/db/mysql/mysql.sock

[mysql]

socket=/storage/db/mysql/mysql.sock

[client]

socket=/storage/db/mysql/mysql.sock

[mysqldump]

socket=/storage/db/mysql/mysql.sock

[mysqladmin]

socket=/storage/db/mysql/mysql.sock

4、Navicat连接不到数据库------被第3个问题影响,解决3,重启mysql服务,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值