×
×

Knowledgebase & Downloads

The knowledgebase provides documentation written by our team. Please select a category or search for answers.

Articles

Can you enable local-infile for MySQL?

Q: Can you enable "local-infile" for MySQL? The default mysql user appears to be missing the necessary permissions to enable us to use the load data infile command. Please could you grant the necessary permissions to the default user so that we can import csv files into our database.

A: Unfortunately this is an option that we will not enable in any of our
shared environments for security reasons. If you absolutely need to import the
data and you do not have it in .sql format, please install a local copy of
MySQL onto your computer, then import the information (for example CVS) using 'LOAD DATA INFILE ...'.
Dump the created data in .sql format (for example: mysqldump db_name table_name > table_name.sql).

While it is additional work on your side, it will allow you to successfully import the
data to our MySQL instance without requiring a server-wide configuration change.

If you absolutely require the "local-infile" option enabled in MySQL with
us, we would suggest a switching to VPS or dedicated server product where you have total freed as for configuration changes.

If you have .sql then you can load it with phpmyadmin or better
- upload the dump.sql with FTP or SCP
- login via SSH
- run: mysql -u cpanelusername_dbusername -p cpanel_username_dbname < dump.sql


Powered by HostBill