Open Database Permissions

Source: Internet
Author: User

Database permission opening 1. The table change method may be that your account cannot log on remotely, but only on localhost. At this time, you only need to log on to mysql on the localhost computer and change the "host" entry in the "user" table in the "mysql" database, from "localhost" to "%" mysql-u root-p mysql> use mysql; mysql> update user set host = '%' where user = 'root '; mysql> select host, user from user; 2. The authorization method runs on the machine where mysql is installed: 1. d: \ mysql \ bin \> mysql-h localhost-u root // enter MySQL Server 2, mysql> grant all privileges on *. * TO 'root' @ '%' with grant option // GRANT data access permissions TO any host. For example, if you want myuser TO use mypassword from any If the host is connected to the mysql server. Grant all privileges on *. * TO 'myuser' @ '%' identified by 'mypassword' wi th grant option; if you want TO allow myuser TO connect TO the mysql server from a host with ip address 192.168.1.6, and use mypassword as the password grant all privileges on *. * TO 'myuser' @ '192. 168.1.3 'identified BY 'mypassword' with grant option; 3. mysql> flush privileges // The modification takes effect. 4. mysql> EXIT the MySQL server, in this way, you can log on to any other host as a root user (important, never forget)

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.