2、安裝yum庫
shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
3、安裝資料庫
shell > yum install -y mysql-community-server
4、啟動mysql服務
shell > systemctl start mysqld.service
5、mysql5.6版本以上會在日誌中生成密碼,
或者:
yum install mysql-serverwget
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
service mysqld start日誌位置:/var/log/mysqld.loggrep "password" /var/log/mysqld.log
檢視密碼:grep 'temporary password' /var/log/mysqld.log
[root@izm5e25656boqyxqrn56epz /]# grep 'temporary password' /var/log/mysqld.log
2017-12-06t02:09:06.230000z 1 [note] a temporary password is generated for root@localhost: lykouf=w1sg
6、登入:
mysql -uroot -plykouf=w1sgh
7、修改密碼
set global validate_password_policy=0;alter user user() identified by 'root123456';
flush privileges;grant all privileges on *.* to root@'%' identified by 'root123456';
flush privileges;
8、這裡可以對密碼進行設定。
set global validate_password_policy=0;
set global validate_password_length=1;指密碼長度
validate_password_number_count
validate_password_special_char_count
validate_password_mixed_case_count
global validate_password_length判斷密碼的標準就基於密碼的長度
其中,validate_password_number_count指定了密碼中資料的長度,
validate_password_special_char_count指定了密碼中特殊字元的長度,
validate_password_mixed_case_count指定了密碼中大小字母的長度。
檢視密碼的設定:
show variables like 'validate_password%';
Linux安裝 MySQL資料庫
1 mysql可以通過rpm安裝,對於perl的依懶性可以在安裝時不管,強制安裝,單獨解決 root localhost usr rpm ivh mysql server 5.1.73 1.glibc23.i386.rpm force nodeps 2 解決perl依賴問題,perl的安裝可以隨意,...
Linux安裝MySQL資料庫
服務端 mysql server community 5.1.44 1.rhel4.i386.rpm 客戶端 mysql client community 5.1.44 1.rhel4.i386.rpm 2 安裝 列印資訊略 root localhost rpm ivh mysql server c...
linux安裝mysql資料庫
1 通過遠端連線工具securefx將mysql安裝包拷貝到伺服器中.2 解壓mysql安裝包 tar zxvf mysql 5.7.19 linux glibc2.12 x86 64.tar.gz mv mysql 5.7.19 linux glibc2.12 x86 64 usr local m...