
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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 Articles
- 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
- Introduction and Installation of Nightmare.js
- Introduction and Installation of Svelte
- nginx ssl certificate installation in linux
- Checking SAP Business One installation programmatically
- Perl Installation on Unix and Linux Platform
- Default location for installation of SAP HANA Studio
- How to get android application first installation date?
