Mysql enables remote services and mysql enables

Source: Internet
Author: User

Mysql enables remote services and mysql enables

Enter mysqlserver

As follows:

Enter password :******
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 810
Server version: 5.6.10 MySQL Community Server (GPL)
Copyright (c) 2000,201 3, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql>

Run the following command:

Grant all privileges on *. * TO 'root' @ '%' identified by '000000' with grant option;

Flush privileges;







How to enable the mysql remote Logon account

1. Check whether the firewall on the server does not block port 3306.
The default port of MySQL is 3306. Make sure that the firewall does not block port 3306. Otherwise, the remote connection fails.
Port 3306 is connected to MySQL.
If you specify another port when installing MySQL, enable the port used by MySQL in the firewall.
2. Added support for remote connection to MySQL users and authorization.
1) first log on to MySQL with the root account
On a Windows host, click the Start Menu, run, and enter "cmd" to enter the MySQL bin directory on the console.
And then enter the following command.
On the Linux host, enter the following command in the command prompt line.
> MySQL-uroot-p123456
123456 is the password of the root user.
2) create a remote login user and authorize
> Grant all PRIVILEGES on discuz. * to ted @ '2017. 123.123.123 'identified by '123 ';
The preceding statement grants all permissions of the discuz database to the ted user, allowing the ted user
123.123.123.123 remote login, and set the ted user password to 123456.
The following describes all the parameters one by one:
All PRIVILEGES indicates that all permissions are granted to the specified user. Here, you can also replace it with a specific permission,
For example, select, insert, update, delete, create, drop, etc. Separate specific permissions with commas.
Discuz. * indicates the table to which the preceding permissions are for, discuz indicates the database, and * indicates
Some tables can infer that the authorization for all tables in all databases is "*. *".
Table authorization is "database name. *", and a table in a database is authorized as "database name. Table name ".
Ted indicates the user you want to authorize. This user can be an existing user or a non-existing user.
123.123.123.123 indicates the IP address that allows remote connection. If you want to restrict the IP address, set it to "%.
123456 is the user's password.
After the preceding statement is executed, the following statement can take effect immediately.

How can I check whether mysql remote access is enabled?

Check whether mysql remote access is enabled?

--------------------------
I don't know what you define?

For a single network check, you can check the parameters:
Mysql> show variables like '% skip_networking % ';
+ ----------------- + ------- +
| Variable_name | Value |
+ ----------------- + ------- +
| Skip_networking | OFF |
+ ----------------- + ------- +
1 row in set (0.00 sec)

Mysql>

If it is on, the network connection is not activated and can only be accessed from the local machine.

If you are referring to permissions, you can check mysql. user to view them:
Select * from mysql. user;

The host column in The result indicates the client machine that is allowed to access (% indicates all machines. If it is only for a certain machine, you can specify an ip address)

Related Article

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.