Home > Database > Mysql Tutorial > body text

Linux下为MySQL配置添加新用户

WBOY
Release: 2016-06-07 16:51:30
Original
2030 people have browsed it

在Linux下构建web应用时,需要远程访问MySQL数据库。我们不推荐在Linux下使用root来登录,而是添加新用户。1)以root用户登录#mysql -u root

在Linux下构建web应用时,需要远程访问MySQL数据库。

我们不推荐在Linux下使用root来登录,,而是添加新用户。

1)以root用户登录
#mysql -u root -p

2)插入新用户,host:%;user:jason;pssword:jason
mysql>insert into mysql.user (host,user,password) values('%','jason',PASSWORD('jason'));

3)更新密码
mysql>update user set password=password('jason') where user='jason'

4)授予权限
mysql>grant all on neuzjs.* to jason@'%' identified by 'jason';
其中neuzjs为数据库名;

5)刷新权限
mysql>flush previleges; 

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template