Do you have a headache in obtaining the actual operations for creating remote login users and granting permissions for MySQL? If this is the case, the following article will provide the actual solution. The following article mainly describes how to create and authorize remote login users for MySQL, the following is a detailed description of the relevant content.
Create a remote login user in MySQL and authorize the user:
- > grant all PRIVILEGES on discuz.* to ted@'123.123.123.123' identified by '123456';
The preceding statement grants all permissions of the discuz database to the ted user, allows the ted user to remotely log on to the IP address 123.123.123.123, and sets 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, such as select, insert, update, delete, create, and drop, separate specific permissions with commas.
Discuz. * Indicates the table to which the preceding Permission applies. discuz indicates the database, and * indicates all the tables. Therefore, we can infer that: authorize "*. * ", authorize all tables of a database to" database name. * ", grant permissions to a table in a database 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.
- > flush privileges;
The above content is an introduction to the creation of remote login users for MySQL. I hope you will gain some benefits.