|
安装mysql
brew install 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(id bigint(7) not null auto_increment,title varchar(200),content varchar(10000),created timestamp default current_timestamp,primary key(id));
查询表:
mysql> show tables;
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)
|
|
|