linux服务器配置jpress以及出现的问题记录
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服务,