Note: I already told you that in the prerequisites section that the remote connection of mysql DB only works if you’ve enabled the incoming connections in the mysql server machine. flush privileges Verify remote database table access on a client system And finally, you may also need to run flush privileges on mysql> prompt. You see the testUser only has remote access to three tables instead of the complete mdc_collector database. To exposed database tables enter the following commands at mysql> prompt.Īfter giving remote access to mysql database tables let’s see the selected grants for testUser with the following query. Now let’s say we want to give access to testUser only billing_data, monthly_billing_data, and load_profile_data tables instead of the complete database. If you guys have seen the above mdc_collector database then you know there are a total of ten tables and we only need to give remote access to some specific tables. You see currently there are no database table grants for the testUser. Grant some specific mysql database tables access to testUserīefore granting remote database tables access lets see the current grants for testUser with the below query. It means our testUser client can connect to mysql database server via any Ip address.Īfter the creation of testUser let’s see all mysql user’s hosts and username with the following query. Please note the % sign in the above command refers to any host. First, let’s create a new mysql user with the following query at mysql> prompt. Now in order to grant some specific database tables access, we need to create a new user (with no grant options) from which our client can access only the exposed tables. You can create your own database or use your existing database.Ĭreate a new mysql user for remote database access You can see this link for enabling the remote connection in the mysql database server.īelow is the example of my complete mysql database. Allow the remote access to the mysql database server by editing the.Open mysql and create a database instance which table access you want to grant.Start the mysql service via sudo systemctl start rvice.Install mysql server on the database server.Before you begin, you must consider the following prerequisites: In this blog post, I’ll focus on how to grant some specific tables remote access when working with mysql database on Linux or Unix-like operating system. Because the client only needs to know about smart meters data, not about the whole application data. So, we don’t want to give the whole database access instead to give access only some specific tables of a database. But before installation, we have met this problem where we need to give mysql database access to our client. Recently, we have completed our project successfully and installed in one of our client’s system. The purpose of MDC is to fetch data from multiple smart meters periodically and stores the data inside the mysql database. So, the project is about to build an MDC (Meter Data Collector). I won’t go in the detail of smart meters because some of you might not be heard of how it works internally. Late last year, my company (Intelligent Metering System) starts a new project on smart meters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |