周玉强 发表于 2018-11-22 14:48:37

mac下安装mysql

安装mysql
brewinstall mysql
mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/mysql/*.plist~/Library/LaunchAg
find /usr/local/Cellar/mysql/ -name "homebrew.mxcl.mysql.plist" -exec cp {} ~/Library/LaunchAgents/ \;
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql.server start
mysql_secure_installation
mysql -uroot


创建表:
mysql> create table pages(idbigint(7) not null auto_increment,title varchar(200),content varchar(10000),created timestamp default current_timestamp,primary key(id));

查询表:
mysql> showtables;
mysql> describe pages;


查询mysql版本:
mysql> status;
mysql> select version();




修改mysql密码:
mysql> alter user root@'%' identified with mysql_native_password by "123456";
Query OK, 0 rows affected (0.13 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

页: [1]
查看完整版本: mac下安装mysql