In version 5.6, MySQL can be more secure by logging in to the database via Mysql_config_editor.
[[email protected] ~]# mysql_config_editor set--login-path=yoon--user=root--password
Log in to the database:
[[email protected] ~]# MySQL--login-path=yoon
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server Version:5.6.26-log Source Distribution
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| Sakila |
| Test |
+--------------------+
5 rows in Set (0.02 sec)
Mysql>
View configuration file, password is hidden directly by encryption
[Email protected] ~]# mysql_config_editor print--all
[Yoon]
user = root
Password = * * * *
host = localhost
VI to edit view configuration file, display a bunch of garbled
[Email protected] ~]# Vi. mylogin.cnf
^@^@^@^@^d^f^r^n^d^[^r^e^f^n^l ^O^ p^e^l^a^n^z^\^p^@^@^@?<99>?? ^y&:7u<9e> ^W^ [^e? J?^p^@^@^@y? j[?? °?| <90>?h?
MySQL more secure login database via Mysql_config_editor