*” 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. Ⓘ Cet article peut avoir été partiellement ou totalement traduit à l'aide d'outils automatiques.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |