![]() Now that the rights have been given, we will have to tell to MySQL that we want to accept external connections to the Raspberry Pi. ![]() Configure MySQL to accept external connections to Raspberry Pi You can now exit MySQL with the command “exit”. Once done, you must tell MySQL to apply the changes made, with the FLUSH command: flush privileges Here “%” is equivalent to saying “all addresses”. is the IP address of the remote machine to which you are granting access rights.“user” means that the assignment of privileges will be done for the user named “user”.*” means that this applies to all tables. *” means that we use the database “example”, and “. Give all the rights on the “example” database and its tables to the user “user” who can connect from anywhere, with the password “the_password”. Literally, you can reads this command like this: Note that it’s not necessary to have a user already created, if the given one does not exist, it will be created automatically. This command contains a lot of information that we will analyze. GRANT ALL PRIVILEGES ON example.* TO IDENTIFIED BY 'the_password' Here, this user will do all the actions of his choice, from any computer, but only on the basis of “example”. We will use the order “GRANT”, use to define the privileges of a user. Now that we are connected, we will create the “example” database: CREATE DATABASE example Your password “root” of MySQL is going to be asked, password that you informed on the installation of MySQL in the Raspberry Pi. To do this, we need to connect to MySQL as root with the following command: mysql -u root –p We will give it rights on the base “example” and no other. Here we will create a new user “user” with the password “password”. Servers are too often the victim of attack such as brute force. However, we want to warn you, creating a remote connection increases the risk of attacks, so use a complicated username and password and avoid giving a user rights to all your tables (it’s better to use a dedicated user by base). Creating a dedicated MySQL userįirst we will have to connect to the Raspberry Pi and then connect to MySQL in order to create a new user to manage a remote database. In addition, opening the connection remotely allows to connect to the MySQL service from another IP (if this one have the authorization) and thus to manage its database without passing by SSH or other services.įor this tutorial we consider that you already have a Raspberry Pi with MySQL server installed. This is especially what the hosts do, on shared servers. Indeed, you can choose to separate these two parts in order to lighten your server in terms of query. ![]() The remote connection can be very useful if you have a server without an internal database. Today, we will be interested in MySQL, more precisely how to activate the remote connection to the database, it mean from another machine not connected to our Raspberry Pi. Nous nous excusons des erreurs que cela pourrait engendrer. I then had to compile MySQL Cluster – ARM isn’t a supported platform and so there are no pre-built binaries.Ⓘ Cet article peut avoir été partiellement ou totalement traduit à l'aide d'outils automatiques. Once up and running on the Pi, the first step was to increase the size of the main storage partition – it starts at about 2 Gbytes – using gparted. I chose the customised version of Debian – you have to copy it onto the SD memory card that acts as the storage for the Pi. This week I received my Raspberry Pi – if you haven’t heard of it then you should take a look at the Raspberry Pi FAQ – basically it’s a ridiculously cheap ($25 or $35 if you want the top of the range model) ARM based PC that’s the size of a credit card.Ī knew I had to have one to play with but what to do with it? Why not start by porting MySQL Cluster onto it? We always claim that Cluster runs on commodity hardware – surely this would be the ultimate test of that claim. I start a long weekend tonight and it’s the kids’ last day of school before their school holidays and so last night felt like the right time to play a bit.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |