6

In my windows forms application I use Mysql to get data. (I use MySql.Data.dll)

Here is my connection string:

server=xxx.xxx.xxx.xxx;user id=user_name;Password=userpass;database=products

When I want use my application on a computer, I must add computer's ip to remote mysql connection on cpanel. I want grant all privileges (on every IP) to user which I use on my connection string.

How can I do it?

Jeff B
  • 8,572
  • 17
  • 61
  • 140
Erdinç Özdemir
  • 1,363
  • 4
  • 24
  • 52

2 Answers2

13

Try giving the user a "Super User" privileges;

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'%' WITH GRANT OPTION;

to add password into the query;

GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'%' identified by 'userpass';
Nadeem_MK
  • 7,533
  • 7
  • 50
  • 61
0
GRANT ALL PRIVILEGES ON *.* TO 'root'@'Hello@123' WITH GRANT OPTION;
  • I think you may be swirling up the query up the loo, mainly the password with the host. As in `'root'@'Hello@123'` should be `'root'@'localhost'` and to set the password, `IDENTIFIED BY 'Hello@123';` Or do you have an explanation to clear this up? [Docs](https://dev.mysql.com/doc/refman/8.0/en/grant.html). – treckstar Jul 24 '22 at 04:13