linux mysql详细使用 摘自beginning linux programming一书

11 篇文章 0 订阅

检测mysl是否启动

ps -el|grep mysqld

4 S     0  2176  1995  0  80   0 -   554 rt_sig pts/0    00:00:00 mysqld_safe
4 S   104  2532  2176  0  80   0 - 79297 poll_s pts/0    00:00:00 mysqld

mysqld_safe是一个以正确的id启动真正的mysqld进程的工具。

 

原文:As with a Linux system, it’s a bad idea to use the root account to log in to MySQL unless it’s absolutely necessary, so you should create an everyday user for normal use.

linux系统不适于用root用户登录mysql,所以应当创建一个日常用户。

原文:the root user is allowed to connect from only the local machine as a security measure.

出于安全考虑,root用户仅可从本地机器连接mysql。

一. Grant方法:

原文:You create users and assign them privileges by using the grant command.

使用grant方法创建用户、赋予用户权限。

1. Create a local login for rick

示例:grant all on *.* to rick@localhost identified by '123456';

2. create a login from anywhere on the class C subnet of 192.168.0. Notice that you must use
single quotes to protect the IP range, and use a mask /255.255.255.0 to identify the range of
IP addresses that are allowed

示例:GRANT ALL ON *.* TO rick@‘192.168.0.0/255.255.255.0’ IDENTIFIED BY ‘secretpassword’;

3. Finally, create a login so that rick can log on from any machine in the wiley.com domain
(again notice the single quotes)

示例:GRANT ALL ON *.* TO rick@‘%.wiley.com’ IDENTIFIED BY ‘secretpassword’;

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值