檢測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’;