Add a new user for MySQL configuration in Linux

Source: Internet
Author: User
When building a web application in Linux, You need to remotely access the MySQL database. We do not recommend using root in Linux to log on, but to add new users. 1) Log On As A root user # mysql-uroot

When building a web application in Linux, You need to remotely access the MySQL database. We do not recommend using root in Linux to log on, but to add new users. 1) Log On As A root user # mysql-u root

When building a web application in Linux, You need to remotely access the MySQL database.

We do not recommend using root to log on in Linux, but adding new users.

1) Log On As A root user
# Mysql-u root-p

2) Insert a new user, host: %; user: jason; pssword: jason
Mysql> insert into mysql. user (host, user, password) values ('%', 'jason ', PASSWORD ('jason '));

3) Update the password
Mysql> update user set password = password ('jason ') where user = 'jason'

4) grant permissions
Mysql> grant all on neuzjs. * to jason @ '%' identified by 'jason ';
Specifically, neuzjs is the database name;

5) Refresh Permissions
Mysql> flush previleges;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.