brew安裝MySQL后初始密碼相關(guān):
https://segmentfault.com/q/1010000004078668?_ea=484006
安裝MySQL
http://www.cnblogs.com/1016882435AIDA/p/6265759.html
創(chuàng)建怯晕、刪除用戶
http://www.cnblogs.com/fly1988happy/archive/2011/12/15/2288554.html
啟動MySQL
sudo ./mysqld_safe --user=mysql &
顯示
7118 pts/9 00:00:00 mysqld_safe
7251 pts/9 00:00:00 mysqld
或者
cd /usr/local/mysql/bin
./mysql -udengkai -p
查看MySQL里的數(shù)據(jù)庫
show databases
查看MySQL是否已啟動
ps -A|grep mysql
以下都是MySQL操作
msql>
創(chuàng)建數(shù)據(jù)庫
create database DKDataBase
打開數(shù)據(jù)庫
use DKDataBase
查看mysql里有多少用戶
select User from mysql.user;
添加一個用戶
grant all on *.* to username@"%" identified by "password" ;
刪除用戶:
退出MySQL
quit
鏈接ip為xxxx.1.1.1的遠(yuǎn)程數(shù)據(jù)庫(在同一局域網(wǎng))
xxxx.1.1.1電腦:
GRANT ALL PRIVILEGES ON . TO '這個電腦的MySQL用戶'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION;
自己電腦:
./mysql -h xxxx.1.1.1 -u xxxx.1.1.1的MySQL用戶 -p密碼