1.下載 http://dev.mysql.com/downloads/workbench/
Mac 只安裝了8.0的版本
使用 org 解壓 改名mysql 移動到 /usr/local 下 初始化后沒有報錯
使用 dmg直接安裝 初始化后報錯 估計部分是 etc/my.cnf 文件那里配置錯了
sudo chmod -R 777 /usr/local/mysql/data/mydatabase 獲取權(quán)限
2.配置環(huán)境變量
/ 打開系統(tǒng)級配置文件 按i 插入
sudo vim/etc/profile
/ 按i插入
export PATH=/usr/local/mysql/bin:/usr/local/mysql/support-files:$PATH
/ w保存 q退出
:wq!
/ 更新環(huán)境
source /etc/profile
打開
vim .zshrc
按i插入
source /etc/profile
/初始化數(shù)據(jù)庫
sudo mysqld --initialize --user=mysql
/啟動本地數(shù)據(jù)庫 a123456 本地數(shù)據(jù)庫進(jìn)入密碼
sudo mysql.server start
登陸本地數(shù)據(jù)庫
mysql -h localhost -P3306 -uroot -p 密碼 上圖密碼
/修改密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'a123456';
//顯示所有數(shù)據(jù)庫
show databases;
//推出賬戶
exit/quit;
/關(guān)閉 數(shù)據(jù)庫
sudo mysql.server stop
忘記密碼
sudo mysqld_safe —skip-grant-tables
https://www.yzktw.com.cn/post/898061.html
ps -ef | grep mysql 查看服務(wù)端進(jìn)程號指令
sudo kill -9 17394 殺死服務(wù)端進(jìn)程 17394進(jìn)程號
https://blog.csdn.net/weixin_52441742/article/details/130819955
補(bǔ)充
https://blog.csdn.net/weixin_54672719/article/details/130775200
分析 有的 通過 /etc/profile 來配置
有的通過.bash_profile 來配置
https://blog.csdn.net/qq_454917294/article/details/118825625
navc 安裝https://zhuanlan.zhihu.com/p/637861715
--- 補(bǔ)充
- 5.7版本
修改mysql的數(shù)據(jù)目錄下的my.ini配置文件 windows
Mac https://www.yzktw.com.cn/post/746573.html
2.各種命令 學(xué)數(shù)據(jù)庫都會接觸到 但是終端也可以用
show databases; //查看所有的數(shù)據(jù)庫
create database 數(shù)據(jù)庫名 ; //創(chuàng)建自己的數(shù)據(jù)庫
use 數(shù)據(jù)庫名; //使用自己的數(shù)據(jù)庫
show tables from 數(shù)據(jù)庫名; //查看某個庫的所有表格create table 表名稱( 字段名 數(shù)據(jù)類型,
字段名 數(shù)據(jù)類型
) ; 創(chuàng)建新的表格 varchar(20) 字符串類型 長度不超過 20
select * from 數(shù)據(jù)庫表名稱; //查看一個表的數(shù)據(jù)insert into 表名稱 values(值列表); //添加一條記錄
show create table 表名稱\G //查看表的創(chuàng)建信息
show create database 數(shù)據(jù)庫名\G //查看數(shù)據(jù)庫的創(chuàng)建信息
drop table 表名稱; //刪除表格
drop database 數(shù)據(jù)庫名; //刪除數(shù)據(jù)庫
查看編碼命令
show variables like 'character_%';
show variables like 'collation_%';
對應(yīng)navcate的安裝
https://zhuanlan.zhihu.com/p/637861715
charles
https://www.macbl.com/app/top/all
MAC 系統(tǒng)多版本 JDK 安裝指南:讓你在開發(fā)中輕松應(yīng)對不同版本需求
https://blog.csdn.net/u011374856/article/details/129087707