Mysql account security question
Posted: 03 Aug 2017 15:05
Is there a valid reason why the hosts 127.0.0.1 and the ::1 for user root have no password assigned?
The host: localhost and user: root use the password from /etc/EFA-Config : MYSQLROOTPWD:******************************************
MariaDB [mysql]> select Host,User,Password from user;
+-----------+-----------+-------------------------------------------+
| Host | User | Password |
+-----------+-----------+-------------------------------------------+
| localhost | root | ************************************** |
| localhost | sa_user | ************************************** |
| 127.0.0.1 | root | |
| ::1 | root | |
| localhost | mailwatch | **************************************|
| localhost | sqlgrey | **************************************|
| localhost | efa | **************************************|
+-----------+-----------+-------------------------------------------+
Can I assign passwords for these accounts or simply remove user root for 127.0.0.1 and ::1?
To disable ipv6 and only listen on localhost I already changed bind-address = 127.0.0.1 in /etc/my.cnf.d/server.cnf.
No problems seen since then, so I think/hope the host ::1 with user root can be disabled without problems anyway, but I want to be sure no to mess up things.
The host: localhost and user: root use the password from /etc/EFA-Config : MYSQLROOTPWD:******************************************
MariaDB [mysql]> select Host,User,Password from user;
+-----------+-----------+-------------------------------------------+
| Host | User | Password |
+-----------+-----------+-------------------------------------------+
| localhost | root | ************************************** |
| localhost | sa_user | ************************************** |
| 127.0.0.1 | root | |
| ::1 | root | |
| localhost | mailwatch | **************************************|
| localhost | sqlgrey | **************************************|
| localhost | efa | **************************************|
+-----------+-----------+-------------------------------------------+
Can I assign passwords for these accounts or simply remove user root for 127.0.0.1 and ::1?
Code: Select all
DELETE FROM mysql.user WHERE user='root' and password='';
FLUSH PRIVILEGES;
Code: Select all
Netstat -tapn
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 13608/mysqld