The first to use the root account to log on locally. ( Https://www.cnblogs.com/CUIT-DX037/p/12378586.html )
Then, execute the following statement:
GRANT ALL PRIVILEGES ON database name . Table name TO ' username ' @ ' Remote IP ' IDENTIFIED BY ' access password ' WITH GRANT OPTION;
In conjunction with the statement: FLUSH PRIVILEGES; sure to submit the above operations.
such as:
Done, you can often use " the remoteuser " accounts and " 1234 " password in the network of any IP address access db_cuit all tables in the database, and has all the authority to operate it.
If you want to assign to this account read-only access , the keyword "you can ALL PRIVILEGES " replace " the SELECT ."
Other common permissions:
-
CREATE - allows user accounts to create databases and tables.
-
DROP - allows user accounts and delete database tables.
-
DELETE - allows the user to delete rows from a specific account table.
-
INSERT - allows the user to insert a row into account specific table.
-
The SELECT - allows the user to read the account database.
-
UPDATE - allows user accounts to update table rows.
If the above operation, remote access exceptions, may also need to do the following:
1. In the local database, restart the MySQL service;
2. In the database locally, turn off the firewall;