brew安装MySQL后初始密码相关:
https://segmentfault.com/q/1010000004078668?_ea=484006
安装MySQL
http://www.cnblogs.com/1016882435AIDA/p/6265759.html
创建、删除用户
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里的数据库
show databases
查看MySQL是否已启动
ps -A|grep mysql
以下都是MySQL操作
msql>
创建数据库
create database DKDataBase
打开数据库
use DKDataBase
查看mysql里有多少用户
select User from mysql.user;
添加一个用户
grant all on *.* to username@"%" identified by "password" ;
删除用户:
退出MySQL
quit
链接ip为xxxx.1.1.1的远程数据库(在同一局域网)
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密码
网友评论