MySQL là một hệ thống quản lý cơ sở dữ liệu mạnh mẽ và miễn phí, được sử dụng để tổ chức và lấy dữ liệu trên Server
Để cài đặt MySQL, bạn thực hiện lệnh sau :
Bạn cần chạy dòng lệnh sau để cấu hình lần đầu cho MySQL
Ví dụ :
Sau đó ta sẽ thấy :
Sau đó :
Để cài đặt MySQL, bạn thực hiện lệnh sau :
|
|
# sudo /usr/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none):Khi tới đoạn “Enter current password for root (enter for none):”, do đây là lần đầu chạy MySQL nên bạn chưa thiết lập password cho tài khoản root của MySQL, nên bạn không nhập gì cả và chỉ nhấn Enter.
Sau đó ta sẽ thấy :
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n]Tới đây, MySQL sẽ hỏi bạn có muốn nhập mật khẩu cho tài khoản root của MySQL? Và tất nhiên bạn sẽ phải nhập “Y” và nhập 2 lần mật khẩu cho tài khoản root. Lưu ý đây là tài khoản có quyền quản trị cao nhất của MySQL, do đó bạn nên chọn mật khẩu có trên 12 ký tự (bao gồm chữ hoa, chữ thường, chữ số và ký tự đặc biệt), sau đó lưu tại 1 nơi bí mật để phòng khi bạn quên mất mật khẩu.
Sau đó :
Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! 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? [Y/n]Tới đây, MySQL sẽ hỏi bạn có muốn xoá tài khoản nặc danh (anonymous), vì lý do an toàn thì bạn nên chọn “Y”
Remove anonymous users? [Y/n] 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? [Y/n]Tại đây, MySQL sẽ hỏi là bạn sẽ không cho đăng nhập tài khoản root từ xa? Và cũng vì lý do an toàn, bạn cũng nên chọn “Y”.
Disallow root login remotely? [Y/n] 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? [Y/n]MySQL hỏi bạn có muốn xoá database test và không cho truy cập vào nó? Bạn chọn “Y” và nhấn Enter để tiếp tục
Remove test database and access to it? [Y/n] 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? [Y/n]Tới “Reload privilege tables now? [Y/n]“, bạn tiếp tục chọn “Y” để hoàn thành
Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL!
Không có nhận xét nào:
Đăng nhận xét