Mysql安装以及密码问题:
因为服务器选择的是CentOS版本,所以在Mysql官网上下载的是red hat的版本
在这里我下载的是安装版本,觉得比较省事,因为安装包之间含有依赖关系,所以本次下载下载了四个安装包
安装顺序为
mysql-community-common-5.7.9-1.el7.x86_64.rpm
mysql-community-libs-5.7.9-1.el7.x86_64.rpm --(依赖于common)
mysql-community-client-5.7.9-1.el7.x86_64.rpm --(依赖于libs)
mysql-community-server-5.7.9-1.el7.x86_64.rpm --(依赖于client、common)
安装成功后启动mysql
# service mysqld start
进入mysql(因为我以为第一次没有密码)
# mysql
[root@iz2ze323sypf1sytcqicfzz bin]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
报错,但此时我又不知道密码是什么,于是修改/etc/my.cnf下的文件
打开刚才我们找到的配置文件,然后在里面找到 [mysqld]
这一项,然后在该配置项下添加 skip-grant-tables
这个配置,然后保存文件,重启mysql。
进入mysql(
# mysql
Server version: 5.7.24
Copyright (c) 2000, 2018, 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>
成功进入,更改密码:update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
*特别提醒注意的一点是,新版的mysql数据库下的user表中已经没有Password字段了
而是将加密后的用户密码存储于authentication_string字段
mysql> flush privileges;
mysql> quit;
修改完毕。重启
在之前的配置文件中注释掉skip-grant-tables
这个配置,然后保存文件,重启mysql。
此时登陆mysql需要输入密码
-------------------分割线-------准备用本地的数据库管理软件连接云服务器上的msyql-------------------------------------------
然后,,问题来了,链接失败
在网上search了一下发现是数据库的权限问题这个问题在我之前的博客出现过了,本来以为再运行一下就好,结果。。。
mysql> grant all privileges on *.* to root@'%' identified by '123456';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
让我reset password,那就reset呗,结果。。。
mysql> set password = password('123456');
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
问题大概就是我设置的密码太简单了。。所以我改了一下密码强度和密码最先长度
set global validate_password_policy=0;
set global validate_password_length=4;
然后就可以安心的设置啦
Tomcat以及项目问题:
eclipse export war 包时闪退的问题