Recently working with the Hive tool, a hive test environment was built. Usually we store the hive metadata information in the outside of MySQL, so we need to install and configure the MySQL database. The next step is to explain the installation and configuration process for MySQL.
installation of MySQL
MySQL installation, you can complete the installation by the following command.
Yum install MySQL mysql-server mysql-devel-y
After the installation is complete, start the MySQL service and start the Service command as follows.
Service mysqld Start
Finally, the root user initializes a password.
mysqladmin-u root password ' password '
This completes the installation of MySQL.
Configuration of MySQL
MySQL is safe, and by default it is not possible to log in remotely, so you need to configure the user so that the root account will operate as an example. The configuration commands are as follows:
GRANT all privileges on * * to ' root ' @ '% '
% indicates that the root login host address can be still address, that is, the address is not limited. The root user grants all permissions to all tables in all databases. This is where you can log in remotely.
MySQL Create user
Because Root is a super administrator, in practice we usually create low-privileged users to use. The next step is to explain the creation of the user and the associated action commands for the configuration.
To create a user:
Granting permissions to users:
Grant all on * * to ' cnblog ' @ '% ' with GRANT OPTION
The above command gives the user all permissions and grants permission to the user (that is, the Cnblog account can create the user and assign permissions to the user). The column in the Red box is the column that has the specified permission.
MySQL user creation and Telnet configuration