MySql安装与运行
1.安装:
brew install mysql
2.如果你当前的环境变量还没有加入 mysql ,手动添加的环境变量中
vi ~/.bash_profile
export PATH=/usr/local/Cellar/mysql/3.6.0/bin:${PATH}
3.启动:
brew services start mysql
mysql.server start
4.安装配置:
mysql_secure_installation
创建数据库
1. 创建数据库data:
mysql -u root -p
create DATABASE data;
2.修改root用户密码:
/usr/local/Cellar/mysql/8.0.12/bin/mysqladmin -u root -p password
2.修改root用户密码等级
mysql> SHOW VARIABLES LIKE 'validate_password%';
mysql> SET GLOBAL validate_password_policy=LOW;