Mysql> Select Host,user from user where host<> ' localhost ' into outfile '/root/aa.txt ';
ERROR 1290 (HY000): The MySQL server is running with the--SECURE-FILE-PRIV option so it cannot execute this statement
Mysql> Show variables like '%secure% '; +--------------------------+-----------------------+
| variable_name | Value |
+--------------------------+-----------------------+
| Require_secure_transport | OFF |
| Secure_auth | On |
| Secure_file_priv | /var/lib/mysql-files/|
+--------------------------+-----------------------+
3 Rows in Set (0.00 sec)
Discovery Secure_auth is on, can be exported, path is/var/lib/mysql-files/
Mysql> Select Host,user from user where host<> ' localhost ' into outfile '/var/lib/mysql-files/test.txt ';
Query OK, 3 Rows Affected (0.00 sec)
Export success
-------------
Mysql> Show variables like '%char% '; View encoding
+--------------------------+----------------------------+
| variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | UTF8MB4 |
| character_set_connection | UTF8MB4 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8MB4 |
| Character_set_server | UTF8MB4 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/share/mysql/charsets/|
+--------------------------+----------------------------+
MySQL Export data