在CentOS 7下安裝MySQL5 7

2021-10-08 02:32:55 字數 1104 閱讀 3932

wget -i -c
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start  mysqld.service

找到預設密碼,必須先進入mysql一次,然後退出mysql.。否則無法正常啟動mysql

grep

"password" /var/log/mysqld.log

mysql -uroot -p

修改密碼策略和字元編碼並重啟

vim /etc/my.cnf
validate_password_policy=0

validate_password = off

character_set_server=utf8

init_connect=

'set names utf8'

systemctl restart mysqld

再次進入mysql,修改密碼並設定遠端訪問

grep

"password" /var/log/mysqld.log

mysql -uroot -p
alter user 'root'@'localhost' identified by 'root'

;

grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;

exit

;

ps:必須按照以上步驟來,否則無法安裝mysql

centos7安裝python的MySQLdb模組

sudo pip install mysql python如果遇到找不到mysql config檔案時,要先安裝 mysql community devel sudo yum install mysql community devel 然後重新sudo pip install mysql pytho...

centos7安裝python的MySQLdb模組

pip install mysql python 如果遇到找不到mysql config檔案時,要先安裝 mysql community devel 安裝mysql源 rpm ivh yum install mysql community devel 然後重新pip install mysql py...

在CentOS 7下安裝Redis

在centos下安裝redis也比較簡單,按照步驟一步一步的操作,基本不會出錯。2 解壓,切換目錄 tar xzf redis 2.8 13.tar.gz cd redis 2.8.13 3 編譯 make make install 4 開啟redis.conf修改配置檔案,最關鍵是下面幾行,其他的...