I suggest you use phpmyadmin.
you need to follow these steps:
- open phpmyadmin
- go to admin section
- click to add user account
- enter username and password
- set privileges
- press the [go] button
that everyone see in action on youtube [ click here ]
if you want to know more about phpMyadmin go with the official
but if there is any special reason to do this with php, here is the comm. sql
CREATE USER 'tesrytss'@'%'//user name IDENTIFIED VIA mysql_native_password USING '***';.//set pass GRANT SELECT, INSERT, UPDATE, DELETE, FILE ON *.* TO 'tesrytss'@'%' // previlages and username and location REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; //other requerment
source share