1. 程式人生 > >新買了一個阿里雲伺服器,部署中遇到的問題

新買了一個阿里雲伺服器,部署中遇到的問題

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

[[email protected] 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 [email protected]'%' 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 包時閃退的問題

https://www.cnblogs.com/areyouready/p/6723626.html