安装mysql:
sudo apt-get install mysql-server mysql-client
然后mysql -V查看mysql是否安装成功
sudo apt-get install libmysqlclient-dev python3-dev
然后
pip install mysqlclient就不会报错找不到'mysql_config'了
# mysql5.7创建用户并授权:
创建数据库
mysql> CREATE USER 'office'@'%' IDENTIFIED BY 'office';
mysql> CREATE DATABASE office DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all privileges on office.* to office@'%' identified by 'office';
mysql> flush privileges;
修改密码:
set password for root@'localhost'=password('xxxx');
注意@'localhost不能省略