Stop the service by running below command: # systemctl stop mysql Next, check the service status by running below command: # systemctl status mysql Start the Percona service with the below command: # systemctl start mysql You can find the configuration file that is used to manage Percona Server in /etc/my.cnf. Percona Server stores the data files in /var/lib/mysql/ by default.
# yum install Percona-Server-server-57 Step 3: Run Percona Server Install the Percona Server by running below command. You should see output similar to the following. Test the repository with the below command. To install Percona Server with SELinux policies, you also need the Percona-Server-selinux-*.noarch.rpm package: # yum install We can install Percona yum repository by running the following command.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : yĩ.The easiest way to install the Percona Yum repository is to install an RPM that configures yum and installs the Percona GPG key. Made so far will take effect immediately. Reloading the privilege tables will ensure that all changes Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y This is also intended only for testing,Īnd should be removed before moving into a production This ensures that someone cannot guess atĭisallow root login remotely? (Press y|Y for Yes, any other key for No) : yīy default, MySQL comes with a database named 'test' thatĪnyone can access. Normally, root should only be allowed to connect from Remove anonymous users? (Press y|Y for Yes, any other key for No) : y You should remove them before moving into a production Testing, and to make the installation go a bit smoother.
Re-enter new password: Re-enter New MySQL Passwordĭo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : yīy default, a MySQL installation has an anonymous user,Īllowing anyone to log into MySQL without having to haveĪ user account created for them. Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2Ĭhange the password for root ? ((Press y|Y for Yes, any other key for No) : y STRONG Length >= 8, numeric, mixed case, special characters and dictionary file MEDIUM Length >= 8, numeric, mixed case, and special characters There are three levels of password validation policy: Press y|Y for Yes, any other key for No: y Would you like to setup VALIDATE PASSWORD plugin? It checks the strength of passwordĪnd allows the users to set only those passwords which are VALIDATE PASSWORD PLUGIN can be used to test passwordsĪnd improve security.
Securing the MySQL server deployment.Įnter password for user root: Enter New Root Password Lưu ý: Sau khi điền mật khẩu ngẫu nhiên, các bạn làm theo hướng dẫn như bên dưới. Sau khi biết mật khẩu ngẫu nhiên thì sử dụng lệnh sau để cài đặt bảo mật cho MySQL: # mysql_secure_installation Sử dụng câu lệnh sau để xem mật khẩu ngẫu nhiên: # grep 'temporary password' /var/log/mysqld.log Lưu ý: Sau khi cài đặt, MySQL 5.7 trở lên tự động tạo một mật khẩu ngẫu nhiên tại /var/log/mysqld.log Kiểm tra phiên bản MySQL đã cài Bước 4: Thiết lập bảo mật cho MySQLĨ. Câu lệnh mysql_secure_installation cho phép bạn thiết lập bảo mật cho MySQL (cài đặt mật khẩu cho tài khoản root, xóa tài khoản vô danh (anonymous users), không cho phép tài khoản root đăng nhập trực tiếp )
# dnf repolist enabled | grep "mysql.*-community.*" # yum repolist enabled | grep "mysql.*-community.*" # yum localinstall Ĥ. Bạn có thể kiểm tra MySQL Yum repository đã được thêm vào hệ thống hay chưa bằng lệnh sau. On Fedora 21 -ģ. Sau khi tải xong, tiếp theo sẽ dùng lệnh yum để cài đặt. Trước khi thực hiện đừng quên sao lưu database nhé.Ģ. Thêm MySQL Yum repository vào hệ thống để cài đặt MySQL. Bước 1: Thêm MySQL Yum Repositoryġ. Hướng dẫn này dùng để cài đặt lên hệ điều hành Linux chưa có MySQL, nếu đã cài MySQL từ nguồn khác, các bạn nên nâng cấp hoặc thay thếbằng phiên bản từ MySQL Yum Repository. Bài viết sau sẽ hướng dẫn các bạn cài MySQL 5.7.9 trên RHEL/CentOS 7/6/5 và Fedora 23/22/21 sử dụng MySQL Yum repository bằng lệnh YUM.