Show
Piyush Diwakar Piyush Diwakarmysql. Mông Cổ. dịch chuyển đỏ. AWS. tiên tri. Sr. DBA tại Paytm Money. Cựu RAKUTEN. Cựu InnoeyeĐã xuất bản ngày 11 tháng 2 năm 2021 + Theo dõi Trong hướng dẫn này, tôi sẽ hướng dẫn bạn cách thay đổi cổng mặc định của mysql và mục đích của mysql_secure_installation là gì Dưới đây là những gì chúng tôi sẽ làm cho mục đích này
Bước 1 - Dừng dịch vụ MySQLĐối với CentOS[root@DBA-Master ~]# service mysqld stop cho Ubuntu[root@DBA-Master ~]# service mysql stop Bước 2 - Thay đổi cổng trong tệp cấu hình MySQLĐối với CentOS[root@DBA-Master ~]# vi /etc/my.cnf [mysqld] port= 4545 datadir= /home/ist/mysql save and exit cho Ubuntu[root@DBA-Master ~]# vi /etc/mysql/mysql.conf.d/mysqld.cnf [mysqld] port=4545 datadir= /home/ist/mysql save and exit Bước 3 - Khởi động lại dịch vụ MySQLĐối với CentOS[root@DBA-Master ~]# service mysqld start cho Ubuntu[root@DBA-Master ~]# service mysql start Bước 4 - Chạy Tập lệnh bảo mật (mysql_secure_installation)[root@DBA-Master ~]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : Y New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y Success. All done! [root@DBA-Master ~]# mysql -uroot -p [root@DBA-Master ~]# service mysql stop0 Đây là video Thuyết trình Thay đổi Port mặc định và bảo mật mysql bằng mysql_secure_installation trong MySQL Xóa MySQL hoàn toàn
Những tài khoản nào có thể bị xóa bằng mysql_secure_installation?Bạn có thể xóa các tài khoản gốc có thể truy cập từ bên ngoài máy chủ cục bộ . Bạn có thể xóa tài khoản người dùng ẩn danh. Bạn có thể xóa cơ sở dữ liệu thử nghiệm, theo mặc định, người dùng ẩn danh có thể truy cập cơ sở dữ liệu này.
mysql_secure_installation có cần thiết không?Có. Sẽ tốt hơn nếu bạn chạy lệnh vì nó cung cấp nhiều tùy chọn bảo mật như. Bạn có thể đặt mật khẩu cho tài khoản root. Bạn có thể xóa tài khoản root có thể truy cập từ bên ngoài máy chủ lưu trữ cục bộ.
Cách gỡ cài đặt MySQLCách gỡ cài đặt MySQL . Dành cho người dùng CentOS và RedHat. sudo yum xóa mysql máy chủ mysql Đối với người dùng Ubuntu và Debian. sudo apt loại bỏ mysql máy chủ mysql Đối với người dùng Fedora (cũng như đối với nhiều bản phân phối phụ). Sudo dnf xóa mysql máy chủ mysql Việc gỡ cài đặt MySQL có xóa cơ sở dữ liệu không?Không, cài đặt lại máy chủ mysql sẽ không xóa các tệp cơ sở dữ liệu của bạn , chỉ xóa các tệp gói của máy chủ mysql. Bạn sẽ có thể truy cập các tệp (cơ sở dữ liệu) của mình sau khi cài đặt lại máy chủ. |