AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Please note, it is not a secure practice. Also, you will need to enable remote access to your database. Determine which users have these privileges by running the following query. If you want to create a remote user to access your database you can replace 127.0.0.1 with Remote IP. Connect to MySQL as a user with the Createuserpriv and Grantpriv. This creates a new read-only MySQL local user that can access your databases. However the process for creating a new MySQL user and assigning permissions is generally similar, regardless of the underlying operating system of your server. GRANT SELECT, SHOW VIEW ON $database_name.* TO IDENTIFIED BY ‘ $password‘ REQUIRE SSL If you want to use SSL connection, you can use the following instead Connect to MySQL as a user with the Createuserpriv and Grantpriv. GRANT SELECT, SHOW VIEW ON $database_name.* TO IDENTIFIED BY ‘ $password‘ You can create a user with table level permissions in MySQL by performing the following: 1. As an example: CREATE USER newuser10.20.30. This will grant all privileges to one database testdatabase (in your case dbTest) to that user on localhost. Grant read-only permission to the MySQL userĬopy the following command and paste them into a MySQL shell. Replace $database_name, $user, and $password below with the values you will be using.ĬREATE USER ‘ IDENTIFIED BY ‘ $password‘ 3. Create a new MySQL userĬopy the following command and paste them into a MySQL shell. Run any database shell that works with MySQL. At a Windows command prompt, run the MySQL command-line program, and log in as an administrator by typing the following command from the MySQL root folder (e.g Program Files\MySQL\MySQL Server 5.5\bin):Ĭ. Here we are running all queries as root account having full privileges to all databases. At a UNIX prompt, run the MySQL command-line program, and log in as an administrator by typing the following commandī. Run the MySQL command-line program by doing one of the following:Ī. Here’s how you can create a read-only MySQL user. Sometimes you need to create a read-only MySQL user credentials for a new team mate to prevent accidental queries being fired into your database.
0 Comments
Read More
Leave a Reply. |