CentOS Server 安装 MySQL 8.0

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

猜你喜欢

转载自blog.csdn.net/u013538542/article/details/81879928