Exporting select result from MySQL and getting the error ‘ERROR 1290 (HY000): The MySQL server is running with the –secure-file-priv option’

To use ‘select … into outfile’ on MySQL the user needs to have the FILE permission as described here.

Even with this privilege however, if there server is running with the –secure-file-priv option you’ll see this error:

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option

When this option is enabled there’s usually one or more paths by default that are configured that you can import and export to. You can find these paths using:

mysql> SHOW VARIABLES LIKE "secure_file_priv";

+------------------+-----------------------+

| Variable_name    | Value                 |

+------------------+-----------------------+

| secure_file_priv | /var/lib/mysql-files/ |

+------------------+-----------------------+

1 row in set (0.02 sec)

Knowing where our trusted location is for importing/exporting, lets try again:

select examplecol from exampletable 
order by createdate desc limit 1 
into outfile '/var/lib/mysql-files/mysqlout.txt';

Success!

This is discussed in answer to this question here.

Oracle Linux 7: “one of the configured repositories failed”

After a fresh install of Oracle Linux 7.4 and trying to run a ‘sudo yum update’ I get:

One of the configured repositories failed (Latest Unbreakable Enterprise Linux Server 7 Server (x86_64)

Following the recommendations following the error didn’t help, and this post suggested trying a ‘sudo yum clean’, but this didn’t fix it either.

Checking if I have network connectivity, it’s seems I can’t ping www.google.com or ping 8.8.8.8. I’ve come across this before with RHEL/CentOS installs and forgetting to enable the network interface options during install. Checking /etc/sysconfig/network-scripts/ifcfg-* the ONBOOT property was set to no. Changing it to yes and rebooting did the trick.