

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
mysql_secure_installation - Improve MySQL Installation Security
What is mysql_secure_installation?
Let us understand the MySQL installation related program mysql_secure_installation −
This program enables the user to improve the security of their MySQL installation in the below mentioned ways:
The user can set a password for root accounts.
The user can remove root accounts which are accessible from outside the local host.
The user can remove anonymous-user accounts.
The user can remove the test database which, by default, can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_.
The mysql_secure_installation helps the user to implement security recommendations.
Normal usage is to connect to the local MySQL server, then invoke mysql_secure_installation without arguments. The example has been shown below −
shell> mysql_secure_installation
When the above statement is executed, mysql_secure_installation prompts the user to determine which actions need to be performed.
Connect to local server
Most of the usual MySQL client options like --host and --port can be used on the command line and in the option files. Let us take an example −
To connect to the local server over IPv6 using port 3307, the below command can be used −
shell> mysql_secure_installation --host=::1 --port=3307
Options
The mysql_secure_installation supports the below options and can be specified on the command line or in the [mysql_secure_installation] and [client] groups of an option file.
--host=host_name, -h host_name
It helps connect to the MySQL server on the given host.
--no-defaults
It doesn’t read any option files. If program startup fails due to reading unknown options from an option file, --no-defaults option can be used to prevent them from being read.
--help, -?
It helps display a help message and exit.
--use-default
It is used to execute noninteractively. This option can be used for unattended installation operations.
--user=user_name, -u user_name
It is the user name of the MySQL account to be used to connect to the server.
- Related Questions & Answers
- MySQL Installation Related Programs
- Steps to upgrade a MySQL installation
- Upgrading a Docker Installation of MySQL
- Important MYSQL Performance Tuning and Settings after Installation
- Cypress Installation (Test Automation)
- Perl Installation on Windows Platform
- Perl Installation on Macintosh Platform
- Explain JMeter installation in macOS
- Checking SAP Business One installation programmatically
- nginx ssl certificate installation in linux
- Perl Installation on Unix and Linux Platform
- Default location for installation of SAP HANA Studio
- How to get android application first installation date?
- What are storage engines and how we can check the list of storage engines supported by MySQL installation?
- Steps to perform installation of SAP HANA plug-ins in Eclipse