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

检测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’;

 

发布了53 篇原创文章 · 获赞 15 · 访问量 25万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章