connect mysql via sql developer

grant命令:

grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;

例子:

  • mysql>grant select,insert,update,delete,create,drop on mydb.mytable to lzpddd@192.168.1.88 identified by ‘mypassword’; //给来自192.168.1.88的用户lzpddd分配可对数据库 mydb的mytable表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为’mypassword’;
  • mysql>grant all privileges on *.* to lzpddd@’%’ identified by ‘mypassword’; //给来自任何IP地址的用户lzpddd分配可对所有数据库的所有表进行所有操作的权限限,并设定口令为’mypassword’;

客户端连接:

进入命令行,windows cmd,连接:

mysql -u 用户名 -p密码 -h 服务器IP地址 -P 服务器端MySQL端口号 -D 数据库名

注意:

(1)服务器端口标志-P一定要大些以区别于用户-p,如果直接连接数据库标志-D也要大写;

(2)如果要直接输入密码-p后面不能留有空格如-pmypassword;

(3)命令结束段没有’;’分号

例子:

mysql -u lzpddd -pmypassword -h 192.168.1.88 -P 3306 -D mydb

或者: mysql -u 用户名 -p // 回车后要求输入密码,密码不可见

连接到本机上的MYSQL命令行

首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格,但是如果-p后带有用户密码,那么-p与密码之间必须没有空格,否则让你重新输入密码.例如以下都是合法的登陆:(帐号:root   密码:123)
mysql -u root -p
mysql -uroot -p
mysql -uroot -p123

如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是: mysql>

via http://blog.csdn.net/rly101112/article/details/8566237

http://rpbouman.blogspot.co.uk/2007/01/oracle-sql-developer-11-supports-mysql.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: