CentOS Server 安裝 MySQL 8.0
阿新 • • 發佈:2018-11-25
1.通過yum安裝
yum -y install mysql mysql-server mysql-devel
2.啟動 MySQL 服務
systemctl start mysqld.service
檢視 MySQL 服務執行狀態
systemctl status mysqld.service
3.檢視 MySQL 的root賬戶的預設密碼
grep “password” /var/log/mysqld.log
4.進入 MySQL
mysql -uroot -p
密碼就用步驟三輸出的
5.修改預設密碼
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘new password’;
6.退出命令列的 MySQL
exit;
在Mac上安裝 mysql
pip install mysql-connector
參考
https://www.cnblogs.com/suxiaoman/p/7693066.html
https://www.cnblogs.com/bigbrotherer/p/7241845.html
https://stackoverflow.com/questions/24272223/import-mysql-connector-python/42124201#42124201
https://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html