tangjianft 2020-06-26
参见: Mac安装Homebrew
brew install mysql
localhost:~ local$ brew install mysql ==> Downloading https://homebrew.bintray.com/bottles/mysql-5.6.26.yosemite.bottle.1.tar.gz Already downloaded: /Library/Caches/Homebrew/mysql-5.6.26.yosemite.bottle.1.tar.gz ==> Pouring mysql-5.6.26.yosemite.bottle.1.tar.gz ==> Caveats A "/etc/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly.
mysql.server start
mysql -uroot
mysql.server stop
/usr/local/bin/mysqladmin -u root password 1234567890(root的新密码) # /usr/local/bin/mysqladmin -> ../Cellar/mysql/8.0.19_1/bin/mysqladmin
mysql_secure_installation
显示如下
There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
按照提示选择密码等级,并设置root密码
mysql -u root -p
local:~# mysql -u root -p Enter password:
CREATE DATABASE IF NOT EXISTS `allinone` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create user ‘adminuser‘@‘%‘ identified by ‘test2020‘;
grant all privileges on allinone.* to ‘adminuser‘@‘%‘;
flush privileges;
show databases;
use allinone; # allinone 为数据库名称
show tables
CREATE TABLE `xmind2chandaocase` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL COMMENT ‘上传xmind文件进行解析:upload=1;\n从禅道导出未xmind用例:export=2;‘, `fire_time` datetime NOT NULL, `ip` varchar(18) NOT NULL, `mac` varchar(48) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
local % mysql.server status SUCCESS! MySQL running (60677) local % mysql.server stop Shutting down MySQL .. SUCCESS! local % mysql.server status ERROR! MySQL is not running local % mysql.server start Starting MySQL . SUCCESS! local % mysql.server status SUCCESS! MySQL running (60992) local %