介绍 Mac 安装 Mysql 与 mysql 在 mac 在的命令
1. brew install
在mac下使用 brew 安装 mysql,之前没有使用过,今天启动的时候发现启动不了
1 2 3
| ➜ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
1 2
| ➜ brew info mysql mysql: stable 8.0.12 (bottled)
|
2. 启动mysql
3. 设置密码
1
| mysql_secure_installation
|
4. 进入mysql
1 2 3 4 5 6 7 8 9 10 11 12
| mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec)
mysql>
|
5. 常用命令
1 2 3 4 5
| $ mysql.server start $ mysql.server restart $ mysql.server stop $ mysql.server status $ mysql -u root -p
|
Reference
Checking if Disqus is accessible...