步骤1:
yum -y install mysql-server
步骤2:
chkconfig mysqld on
步骤3:
service mysqld start
mysql -u root
set password for root@localhost=password(‘root‘);
登录mysql创建新用户:
create user ‘test_user‘@‘%‘ identified by ‘test_user‘;
.给新用户test_user授权,让他可以从外部登陆和本地登陆
注意:@左边是用户名,右边是域名、IP和%,表示可以访问mysql的域名和IP,%表示外部任何地址都能访问。
grant all privileges on *.* to ‘test_user‘@‘localhost‘ identified by ‘test_user‘;
grant all privileges on *.* to ‘test_user‘@‘%‘ identified by ‘test_user‘;
原文:http://www.cnblogs.com/lvlv/p/4834036.html